#include <ie.au3>
$pdfurl=1
$oie = _IECreate("http://www.sciencedirect.com/science/article/pii/B9780122841514500002", 1, 1, 1, 0)
;$Timer4 = TimerInit()
$a = 1
$win = 0
Do
Sleep(60)
If WinExists("连接到 web2.ucsd.edu", "") Then
$win = 1
MsgBox(0,0,"proxy")
ControlSend("连接到 web2.ucsd.edu", "", "", '{Enter}')
Sleep(1000)
$a = $a + 1
EndIf
Until $win = 1 Or $a > 60
$b = 1
$winb = 0
Do
Sleep(60)
If WinExists("连接到", "") Then
$win = 1
ControlSend("连接到", "", "", '{Enter}')
Sleep(5000)
$b = $b + 1
EndIf
Until $winb = 1 Or $b > 10
$loadie = _IELoadWait($oie)
If $loadie = 1 Then
$links = _IELinkGetCollection($oie)
For $link In $links
If StringLower($link.title) = "download pdf" Then
MsgBox(0, "", $link.href)
$pdfurl=$link.href
ExitLoop
EndIf
Next
EndIf
If $pdfurl<>1 Then MsgBox(0,0,"pdffounded")
|