本帖最后由 zhangjun5432 于 2013-12-8 18:32 编辑
我想让au3自动点击百度新闻里的红色大标题如习近平就曼德拉逝世向南非总统祖马致唁电
代码如下:#include <IE.au3>
$oIE = _IECreate("http://news.baidu.com/")
_IELinkClickByText ($oIE, "习近平就曼德拉逝世向南非总统祖马致唁电")
点击无效#include <IE.au3>
$oIE = _IECreate ("http://news.baidu.com/")
$oTags = _IETagNameGetCollection ($oIE,"A")
For $oTag In $oTags
If StringInStr($oTag.href,"http://politics.people.com.cn/n/2013/1207/c1024-23772735.html") then
; $oTag.click()
_IEAction($oTag,"click")
EndIf
Next
点击无效,用$oTag.click()语句点击也无效#include <IE.au3>
$oIE = _IECreate ("http://news.baidu.com/")
$oTags = _IETagNameGetCollection ($oIE,"A")
For $oTag In $oTags
If StringInStr($oTag.href,"http://politics.people.com.cn/n/2013/1207/c1024-23772735.html") then
MsgBox(0,"","已找到")
EndIf
Next
运行这个程序,“已找到”仅出现1次,这说明此程序能找到所需点击的标题,然而点击却无效,请大侠们帮忙看看,多多指点。谢谢! |