Jump to content

Recommended Posts

Posted

Hi

I'm trying to check if an image exists on the current page

I've got;

$img = _IEImgGetCollection($oIE)

But I don't know what to do from here

Any help appreciated

ThNx

Posted (edited)

#include <IE.au3>

$oIE = _IECreate ("http://www.autoitscript.com/")

$sImgToLookFor = "hi.jpg" ; Fill this in with whatever you're looking for
$bImgIsThere = False

$oImgs = _IEImgGetCollection ($oIE)
For $oImg In $oImgs
 If $oImg.src = $sImgToLookFor Then ; or to use a partial string: If StringInStr($oImg.src,$sImgToLookFor) Then
  $bImgIsThere =  True
  ExitLoop
 EndIf
Next

If $bImgIsThere Then
 MsgBox(0,"","The image has been found on the page")
EndIf

Edited by Manadar

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
  • Recently Browsing   0 members

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