cppwebbrowser点击网页中的按钮
我在cppwebbrowser中载入了百度主页 想要用程序自动点击 搜索按钮
网上搜了段代码如下
Variant disp,alllinks,eachlink;
int linkcount;
disp = CppWebBrowser1->Document;
alllinks = disp.OlePropertyGet("links"); //取得所有的链接
linkcount = alllinks.OlePropertyGet("length"); //取得链接的数量
for (int i=0;i<linkcount;i++)
{
eachlink = alllinks.OleFunction("item",i); //依序取得每一個链接
if (eachlink.OlePropertyGet("innerText")==(Variant)strURL) //判断中的文字
{
eachlink.OleFunction("click"); //按下链接
break;
}
}
不清楚 按钮算不算链接? 请问应该如何修改 或者怎么实现呢?