Jump to content

URL doubts


Recommended Posts

exists some possibility to change the URL with some function to only modify the numeration ( in red ) of the pages, like: /101/1.html ; /102/1.html ;

/103/1.html ; /104/1.html ; /105/1.html ; /106/1.html ; /107/1.html ;?

#include <IE.au3>

$sImgDir = "c:\POP\"

$sWebPage = "http://qualquercoisa.pt/picture/100/1.html"; webpage with images

I tried something as but without results

Do

$i = X + 1

Until X = 200

Link to comment
Share on other sites

  • Moderators

Try this:

#include <IE.au3>

$oIE = _IECreate()
$sImgDir = "c:\POP\"

For $i = 1 To 200
    _IENavigate($oIE, "http://qualquercoisa.pt/picture/" & $i & "/1.html")
    $oIMGs = _IEImgGetCollection($oIE)
    ; Loop through all IMG tags and save file to local directory using INetGet
    For $oIMG In $oIMGs
        $sImgUrl = $oIMG.src
        $sImgFileName = $oIMG.nameProp
        InetGet($sImgUrl, $sImgDir & $sImgFileName)
    Next
Next
Link to comment
Share on other sites

Thanks big_daddy.

one more question, I can make this ( in red ) is possivel?

$oIE = _IECreate()

$sImgDir = "c:\POP\"

For $i = 001 To 200 ; 001 , 002, 003, to 200

_IENavigate($oIE, "http://qualquercoisa.pt/picture/" & $i & "/1.html")

$oIMGs = _IEImgGetCollection($oIE)

; Loop through all IMG tags and save file to local directory using INetGet

For $oIMG In $oIMGs

$sImgUrl = $oIMG.src

$sImgFileName = $oIMG.nameProp

InetGet($sImgUrl, $sImgDir & $sImgFileName)

Next

Thanks

Link to comment
Share on other sites

  • Moderators

Try this:

#include <IE.au3>

$oIE = _IECreate()
$sImgDir = "c:\POP\"

For $i = 1 To 200
    Switch $i
        Case 0 To 9
            $i = "00" & $i
        Case 10 To 99
            $i = "0" & $i
    EndSwitch
    _IENavigate($oIE, "http://qualquercoisa.pt/picture/" & $i & "/1.html")
    $oIMGs = _IEImgGetCollection($oIE)
    ; Loop through all IMG tags and save file to local directory using INetGet
    For $oIMG In $oIMGs
        $sImgUrl = $oIMG.src
        $sImgFileName = $oIMG.nameProp
        InetGet($sImgUrl, $sImgDir & $sImgFileName)
    Next
Next
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...