Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27124

URGENT webpage element help please

$
0
0
Right I don't like asking but I really cant find this anywhere and know the answer will be simple but I just cant get my head around it

Say you have a web page with 50 images with the same id,alt,classname etc the same and I wanted to click the 4th how would i go about doing this?

I was thinking looping through each one until the loop count reaches 4 but I cant seen to get it working


Dim PageElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("img")
for i = 0 to pageelements.count
if i = 4 then pageelement.invokemember("click")
next i

the above code is completely wrong but this was the closest i was getting

Thanks in advance

Viewing all articles
Browse latest Browse all 27124

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>