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

[IE类操作] 获取滚动新闻列表中特定网址

  [复制链接]
发表于 2014-7-16 18:22:18 | 显示全部楼层 |阅读模式
悬赏50金钱未解决
腾讯滚动新闻列表页
http://roll.news.qq.com

每页显示20条,想要抓取每一条链接,抓取20页,重复自动剔除
放到记事本中

发表于 2014-7-16 23:05:19 | 显示全部楼层
用正则提取一下
发表于 2014-7-19 13:50:46 | 显示全部楼层
坐等高手,学习下,感谢
发表于 2014-7-19 18:22:58 | 显示全部楼层
#include <ie.au3>
#include <array.au3>

$dic=ObjCreate("scripting.dictionary")
$oie=_IECreate("http://roll.news.qq.com/",0,1,1,0)
For $n=1 To 20
        $oie.document.parentwindow.execscript('gotoPage('&$n&')')
        $ok=False
        Do
                Sleep(100)
                For $link In $oie.document.links
                        If StringRegExp($link.href,"(?is)http\:\/\/news\.qq\.com\/a\/",0)=1 Then
                                $ok=True
                                ExitLoop
                        EndIf
                Next
        Until Not $oie.busy And $oie.readystate=4 And $ok
        For $link In $oie.document.links
                If StringRegExp($link.href,"(?is)http\:\/\/news\.qq\.com\/a\/",0)=1 Then
                        $dic($link.href)=$link.innertext
                EndIf
        Next
Next
$oie.document.parentwindow.execscript('javascript:window.opener=null;window.open("","_self");window.close();')
$arr=$dic.keys
Dim $result[UBound($arr)][2]
For $n=0 To UBound($arr)-1
        $result[$n][0]=$arr[$n]
        $result[$n][1]=$dic($arr[$n])
Next
_ArrayDisplay($result)
不算啥好方法,开拓一下思路吧
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 04:07 , Processed in 0.076532 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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