11-05-2009, 03:19 AM
How do I use three filters to grab the count of web objects on a page?
I want to get the number of objects on a page where the objects have these values:
micClass = WebElement
html tag = SPAN
x = 180
Here is the code I have so far:
=================================================
=================================================
The msgbox should come back with a count of 4 instead it comes back as 93.
Any ideas?
SBsteven
I want to get the number of objects on a page where the objects have these values:
micClass = WebElement
html tag = SPAN
x = 180
Here is the code I have so far:
=================================================
Code:
'Gather the number of filtered objects on the website.
On Error Resume Next
webCount = 0
Set Doc = Browser("micClass:=Browser").Page("micClass:=Page").Object
'Loop through all the objects in the page.
For Each Element In Doc.all
If Element.TagName = "SPAN" and Element.x = 180 then
webCount = webCount + 1
End If
Next
Msgbox "The number of objects are " & webCount
The msgbox should come back with a count of 4 instead it comes back as 93.
Any ideas?
SBsteven