Jump to content

Download web images and diff with a local image


hammy
 Share

Recommended Posts

I am exploring AutoIT for use with Tivoli Monitoring.

I need to analyze the pages images and confirm that they have not changed.

I have thought of a few ways to do this but I was hoping someone might have a suggested solution.

Right now I am trying to figure out how to find the image file in cache or download it to a known directory. Then I can compare it to a locally stored copy.

Edited by hammy
Link to comment
Share on other sites

Ok I found this code in the IE.au3 thread

#include <IE.au3>

$sImgDir = "c:\foo\"; Please make certain this folder already exists (silent failure if not)
$sWebPage = "http://www.autoitscript.com/forum/index.php?"; webpage with images

$oIE = _IECreate()
_IENavigate($oIE, $sWebPage)
$oIMGs = _IETagNameGetCollection($oIE.document, "img")

; 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

IE.au3 Thread

Now I just need to figure out how to call the DOS comp command or call a commandline diff program.

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...