Jump to content
Sign in to follow this  

Counting the Number of Img's with their .src on IE?

Recommended Posts


Aye guys, let's say you have a webpage open. There are 20 pictures total, and some of them are pictures of trees. You don't know how many 'trees' there are, and you want to find out, and click them all. So is it possible to get the number of total images on a webpage, based on their src? This is my code for clicking all the ones with the same .src

$oLinks = _IELinkGetCollection($oIE)
    For $oLink In $oLinks
        $x = 0
        If $oLink.href = 'The images.src'  Then
            $x = $x + 1    ; That was gonna be how many have been clicked so far. Now I want to get [ out of total images... ]

So how would I get the total number of that image I'm clicking?

Share this post

Link to post
Share on other sites

Get "$x = 0" outside the loop. You are resetting the count to 0 on every loop.


Thanks, but already fixed that. :evil:

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.