找回密码
 加入
搜索
查看: 3244|回复: 5

[AU3基础] 如何自动搜索网页中的文字并点击它

[复制链接]
发表于 2010-10-19 13:41:39 | 显示全部楼层 |阅读模式
比如http://www.163.com 打开这个网站 想搜索"新闻"这2个字,搜索到后自动点击它,请问怎么实现啊  谢谢大家
发表于 2010-10-19 14:27:20 | 显示全部楼层
$oIE = _IECreate ("http://www.163.com",0,1,0)   
_IELinkClickByText($oIE,'新闻')
发表于 2010-10-20 04:32:04 | 显示全部楼层
2 楼代码不全,我记得还要加上个  IE.au3
发表于 2010-10-20 04:32:22 | 显示全部楼层
#include <IE.au3>
发表于 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
发表于 2010-10-28 14:24:15 | 显示全部楼层
回复 5# qq123123
测试完毕:
第1个例子没反应,第2个OK.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-20 23:26 , Processed in 0.080432 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表