不要想复杂了~#include <Array.au3>
Local $sURL = 'http://windows.microsoft.com/zh-cn/windows/downloads/personalize/wallpaper-desktop-background?T1=all'
Local $oHTTP = ObjCreate('microsoft.xmlhttp')
$oHTTP.Open('get', $sURL, 0)
$oHTTP.Send()
Local $Str = BinaryToString($oHTTP.responseBody, 4)
Local $aSR = StringRegExp($Str, 'href="([^"]+?jpg)".+?\s+.+?title="([^"]+)', 3)
If @error Then Exit
_ArrayDisplay($aSR, UBound($aSR))
;------ 以下添加批量下载任务到迅雷
Local $oTd = ObjCreate('ThunderAgent.Agent.1')
If IsObj($oTd) Then
For $i = 0 To UBound($aSR) - 1 Step 2
$oTd.AddTask4($aSR[$i], $aSR[$i + 1] & '.jpg', @ScriptDir & '\Wallpaper')
Next
$oTd.CommitTasks2(1)
EndIf
|