#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)
不算啥好方法,开拓一下思路吧 |