goodchap 发表于 2010-10-19 13:41:39

如何自动搜索网页中的文字并点击它

比如http://www.163.com 打开这个网站 想搜索"新闻"这2个字,搜索到后自动点击它,请问怎么实现啊谢谢大家

shano 发表于 2010-10-19 14:27:20

$oIE = _IECreate ("http://www.163.com",0,1,0)   
_IELinkClickByText($oIE,'新闻')

qq123123 发表于 2010-10-20 04:32:04

2 楼代码不全,我记得还要加上个IE.au3

qq123123 发表于 2010-10-20 04:32:22

#include <IE.au3>

qq123123 发表于 2010-10-20 04:34:05

#include <IE.au3>
$oIE = _IE_Example ("basic")
_IELinkClickByText ($oIE, "user forum")

; *******************************************************
; Example 2 - Open browser to the AutoIt homepage, loop through the links
;                                on the page and click on the link with text "wallpaper"
;                                using a sub-string match.
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate("http://www.autoitscript.com")

$sMyString = "wallpaper"
$oLinks = _IELinkGetCollection($oIE)
For $oLink in $oLinks
        $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
                _IEAction($oLink, "click")
                ExitLoop
        EndIf
Next

newuser 发表于 2010-10-28 14:24:15

回复 5# qq123123
测试完毕:
第1个例子没反应,第2个OK.
页: [1]
查看完整版本: 如何自动搜索网页中的文字并点击它