amir123321 Posted December 9, 2015 Share Posted December 9, 2015 auto it open a site and download file Link to comment Share on other sites More sharing options...
amir123321 Posted December 9, 2015 Author Share Posted December 9, 2015 i want to open site (forexample: http://ieeexplore.ieee.org/xpl/tocresult.jsp?isnumber=6690268) that i canbut i can't and i don't know how to click the pdf icon. I mean that i want to open 22 pdf. (i want the autoit goes to this site and click on all of pdf) but i can't can you help me?Thanks Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 9, 2015 Moderators Share Posted December 9, 2015 Duplicate Topics merged. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Trong Posted December 9, 2015 Share Posted December 9, 2015 This script will help you automatically download the all PDF file without pressing or opening the browser.Note: Does not support the path need login or to purchase. (on IEEE Xplore)expandcollapse popup#include <INet.au3> #include <String.au3> Global $SaveDir = @DesktopDir & "\" Global $URLD = 'http://ieeexplore.ieee.org/xpl/tocresult.jsp?reload=true&isnumber=6690268' Global $iOverwrite = 0 Local $HTMLSource = StringStripWS(_INetGetSource($URLD), 7) Local $_Arrayline = StringSplit($HTMLSource, @LF) For $i = 1 To $_Arrayline[0] If StringInStr($_Arrayline[$i], 'PDF file icon') Then Local $sPathSavePDFF, $sFileName, $sName, $hSRC, $nLine, $sUrlPDF, $StrTMP0, $StrTMP1, $StrTMP2, $StrTMP3, $StrTMP4 = $_Arrayline[$i] $StrTMP2 = _StringBetween($StrTMP4, 'arnumber=', '"><img') If IsArray($StrTMP2) Then $sName = $StrTMP2[0] $StrTMP1 = _StringBetween($StrTMP4, 'Download or View the PDF:', '" href="') If IsArray($StrTMP1) Then $sFileName = StringStripWS(StringReplace(StringReplace(StringRegExpReplace($StrTMP1[0], '[[:^print:]]', "_") & " (" & $sName & ").pdf", '/', "_"), ':', "-"), 7) $StrTMP0 = _StringBetween($StrTMP4, '" href="', '"><img class="') If IsArray($StrTMP0) Then $hSRC = _INetGetSource('http://ieeexplore.ieee.org' & $StrTMP0[0]) $nLine = StringSplit($hSRC, @LF) For $x = 1 To $nLine[0] If StringInStr($nLine[$x], '<frame src="http') Then $StrTMP3 = _StringBetween($nLine[$x], '<frame src="', '" frameborder=0 />') If IsArray($StrTMP3) Then $sUrlPDF = $StrTMP3[0] EndIf Next EndIf If $sUrlPDF <> "" And $sFileName <> "" Then $sPathSavePDFF = StringStripWS($SaveDir & $sFileName, 7) If FileExists($sPathSavePDFF) And Not $iOverwrite Then ConsoleWrite("- Skip file: " & $sFileName & @CRLF) ContinueLoop Else If FileExists($sPathSavePDFF) Then FileDelete($SaveDir & $sFileName) ConsoleWrite("! Overwrite file: " & $sFileName & @CRLF) EndIf ConsoleWrite("+ Download file: " & $sFileName & "|" & $sUrlPDF & @CRLF) TrayTip("Download file from: " & $sUrlPDF, " Save file to:" & $sPathSavePDFF, 1, 1) InetGet($sUrlPDF, $sPathSavePDFF, 8, 1) EndIf EndIf EndIf Next Sorry I'm a beginner. Regards, Link to comment Share on other sites More sharing options...
Jury Posted December 10, 2015 Share Posted December 10, 2015 (edited) Or perhaps if you are logged in:#include <INet.au3> $i = 0 $filewhole = _INetGetSource("http://ieeexplore.ieee.org/xpl/tocresult.jsp?reload=true&isnumber=6690268", True) Sleep(3000) $nOffset = 1 While 1 $array = StringRegExp($filewhole, '(?i)(?-s)<li aria-describedby="art-abs-title-(0*\d+)', 1, $nOffset) If @error = 0 Then $nOffset = @extended Else ExitLoop EndIf $i = $i + 1 If $i = 22 Then ConsoleWrite('>> http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=' & $array[0] & @CRLF) ;InetGet('http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=' & $array[$i], $directory & "\" & $array[$i] * '.pdf') Else ConsoleWrite('http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=' & $array[0] & @CRLF) EndIf WEnd Edited December 10, 2015 by Jury Link to comment Share on other sites More sharing options...
Trong Posted December 30, 2015 Share Posted December 30, 2015 Please do not send the request via private message.If you need support, please create topics so that everyone can help you.#include <INet.au3> #include <String.au3> Local $URLD = 'http://ieeexplore.ieee.org/xpl/tocresult.jsp?reload=true&isnumber=6690268' ConsoleWrite("+ Please waiting..." & @CRLF) Local $HTMLSource = StringStripWS(_INetGetSource($URLD), 7) Local $sLineHTML = StringSplit($HTMLSource, @LF) Global $sOUTPUT For $i = 1 To $sLineHTML[0] If StringInStr($sLineHTML[$i], '<span id="art-abs-title-') Then Local $vPID, $vTitle, $sDOI, $hSRC, $nLine, $StrTMP Local $cLineHTML = $sLineHTML[$i] $StrTMP = _StringBetween($cLineHTML, 'art-abs-title-', '">') If IsArray($StrTMP) Then $vPID = $StrTMP[0] $StrTMP = _StringBetween($cLineHTML, '<span id="art-abs-title-' & $vPID & '">', '</span>') If IsArray($StrTMP) Then $vTitle = $StrTMP[0] $hSRC = _INetGetSource('http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=' & $vPID) $nLine = StringSplit($hSRC, @LF) For $x = 1 To $nLine[0] If StringInStr($nLine[$x], "<a href='http://dx.doi.org") Then $StrTMP = _StringBetween($nLine[$x], ' target="blank">', '</a>') If IsArray($StrTMP) Then $sDOI = $StrTMP[0] Else $sDOI = "Not Found" EndIf EndIf Next ConsoleWrite("! ID:" & $vPID & " - DOI:" & $sDOI & " - " & $vTitle & @CRLF) $sOUTPUT &= $vTitle & "ID:" & @CRLF & $vPID & " - DOI:" & $sDOI & @CRLF EndIf Next MsgBox(0, "Complete: See Console Output!", $sOUTPUT) Regards, Link to comment Share on other sites More sharing options...
jguinch Posted December 30, 2015 Share Posted December 30, 2015 Another way :$sSource = BinaryToString(InetRead("http://ieeexplore.ieee.org/xpl/tocresult.jsp?reload=true&isnumber=6690268")) $aLinks = StringRegExp($sSource, '<a aria-label="Download or View the PDF:\h*([^"]+)" href="([^"]+)', 3) For $i = 0 To UBound($links) - 1 Step 2 $sPDFName = StringRegExpReplace($links[$i], "[^\w ]", "") & ".pdf" InetGet("http://ieeexplore.ieee.org/" &$links[$i + 1], @ScriptDir & "\" & $sPDFName, 1) Next Trong 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now