Jump to content

how to get collection using outhtml


joeloyzaga
 Share

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)
    exitloop
    EndIf
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...