Jump to content
Sign in to follow this  

how to get collection using outhtml

Recommended Posts


I am getting the collection of all images on my web page (IE) and am getting 71 images

I'd like to narrow it down to only images with outer html "<IMG onmousedown="javascript:toggleVisibility*." - which is a regular expression

This way I get only 3 images I want to work on... the code below gives me 4 images but when I click on the first image - it expands the page so I have to re-get the collection and the expanded page still retains the 4 images but now I want to work on the 3 unexpanded ones - they contain the string above so i can get them into their own collection to work on if I can use the string in a regular expression - can anybody help please?

$sMyString = "expand_btn.gif"
$oImgs = _IEImgGetCollection ($oIE)
$iNumImg = @extended
For $oImg In $oImgs
    $imagealt=_IEPropertyGet($oImg, "file name")
    If StringInStr($oImg.nameProp, $sMyString) then
    _IEImgClick($oImg,$sMyString, "src",0,0)

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