找回密码
 加入
搜索
查看: 2095|回复: 4

阿里巴巴网站某链接如何点击?

[复制链接]
发表于 2008-11-4 11:49:00 | 显示全部楼层 |阅读模式
如同:


http://search.china.alibaba.com/ ... 033180&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[0][0] = "跟我洽谈" then
    _IEAction ($oInput, "click");此处变量应该有问题
EndIf
$i += 1
Next


[ 本帖最后由 bob 于 2008-11-5 23:02 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2008-11-4 14:55:14 | 显示全部楼层
你改一改就应该可以点中那个"跟我洽谈"了:


#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)
发表于 2008-11-4 15:13:52 | 显示全部楼层
按楼主这要求能做出旺旺垃圾广告群发器
发表于 2008-11-6 21:17:51 | 显示全部楼层
太强了。。。。
发表于 2008-11-6 21:48:35 | 显示全部楼层
狮子好强大
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-24 19:32 , Processed in 0.073318 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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