#include <IE.au3>
Local $oIE = _IECreate("http://www.baidu.com/")
_IELoadWait($oIE)
Local $oDiv = _IEGetObjById($oIE, "kw")
_IEFormElementSetValue($oDiv, "beautiful")
Local $oBtnSearch = _IEGetObjById($oIE, "su")
_IEAction ($oBtnSearch, "click")
_IELoadWait($oIE)
$oLinks = _IELinkGetCollection ($oIE)
Local $kwstr="百度词典"
For $oLink In $oLinks
$intext=_IEPropertyGet($oLink, "innertext")
Local $result = StringInStr($intext, $kwstr)
;MsgBox(0, "Link Info", "$text is " & $result)
If ($result) Then
MsgBox(0, "Link Info", "$text is " & $intext)
EndIf
Next
_IEQuit($oIE)
Local $oIE = _IECreate("http://www.baidu.com/")
_IELoadWait($oIE)
Local $oDiv = _IEGetObjById($oIE, "kw")
_IEFormElementSetValue($oDiv, "beautiful")
Local $oBtnSearch = _IEGetObjById($oIE, "su")
_IEAction ($oBtnSearch, "click")
_IELoadWait($oIE)
$oLinks = _IELinkGetCollection ($oIE)
Local $kwstr="百度词典"
For $oLink In $oLinks
$intext=_IEPropertyGet($oLink, "innertext")
Local $result = StringInStr($intext, $kwstr)
;MsgBox(0, "Link Info", "$text is " & $result)
If ($result) Then
MsgBox(0, "Link Info", "$text is " & $intext)
EndIf
Next
_IEQuit($oIE)
AutoIT操作百度搜索
本文介绍了一段使用AutoIT脚本实现对百度网页进行搜索操作的过程。通过创建IE实例并加载百度首页,设置搜索关键词为“beautiful”,点击搜索按钮,然后遍历页面上的链接寻找包含“百度词典”的链接。
418

被折叠的 条评论
为什么被折叠?



