阿里巴巴网站某链接如何点击?
如同:http://search.china.alibaba.com/selloffer/rfid/1.html?max_cat_id=1033180&offset=2
主要是想点击页面中“跟我洽谈”的链接地址
这是网页中相关源代码
<table height="50" class="list_mt4 ff_m1">
<tr valign="top">
<td align="center"><a href="javascript:h324798('222404094','asgcc249845','isOnline','SALE','pm','1033171',0)" onmousedown="searchclick(this,'?infor=searchsell_1_1_jy_j2_altalk_rfid_1033171');doParrotTrace(this,'?type=alitalk&sourcetype=searchsell&memberLevel=&toid=asgcc')"target="_self"> 跟我洽谈 </a></td>
</tr>
</table>
我写的代码,可惜行不通
#include <IE.au3>
#include <Array.au3>
$oIE = _IECreate("http://search.china.alibaba.com/selloffer/rfid/1.html?max_cat_id=1033180&offset=2",0,1,1,0);创建一个IE浏览器窗口
_IEAction($oIE,"visible");设置对象状态为可见
$oInputs = _IETableGetCollection ($oIE) ;返回指网页内所有表格的目标变量
$i = 0
For $oInput In $oInputs
$table = _IETableGetCollection ($oIE,$i)
$oInput = _IETableWriteToArray ($table) ;读取指定表格内的数据,写入到数组
if $oInput = "跟我洽谈" then
_IEAction ($oInput, "click");此处变量应该有问题
EndIf
$i += 1
Next
[ 本帖最后由 bob 于 2008-11-5 23:02 编辑 ] 你改一改就应该可以点中那个"跟我洽谈"了:
#include <IE.au3>
$oIE = _IECreate("http://search.china.alibaba.com/selloffer/rfid/1.html?max_cat_id=1033180&offset=2",0,1,1,0)
Dim $string = '', $i = 0
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
If StringInStr($oLink.href, 'javascript:')<> 0 And StringInStr($oLink.href, 'isOnline')<> 0 Then
If StringInStr($string, $oLink.href) Then
;~ _IEAction($oLink, 'click')
ContinueLoop
Else
$i += 1
$string &= $i & '=' & $oLink.href & @CRLF
EndIf
EndIf
Next
MsgBox(64, "Link Info", '共有"谈生意"链接:' & $i & @CRLF & $string)
按楼主这要求能做出旺旺垃圾广告群发器:face (13): 太强了。。。。 狮子好强大
页:
[1]