Sign in to follow this  
Followers 0
lyx

IE check if image exist

4 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

Thnx...

but it didn't work, BLEH

the image only appears after 30 secs (GUESS WHICH WEBSITE :) )

Share this post


Link to post
Share on other sites

.

Share this post


Link to post
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
Sign in to follow this  
Followers 0