Well I need to be able to click this picture out of my webbrowser in VB.
<img src="/images/skip_ad/en.png" alt="Skip Ad" height="39" id="skip_ad_button"
I have tried this code:
Dim col As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("img")
For Each elem As HtmlElement In col
If elem.GetAttribute("src").Contains("/images/skip_ad/en.png") Then
elem.InvokeMember("click")
ListBox1.Items.Add("clicked")
End If
And this code:
Dim col As HtmlElementCollection = Bot.Document.GetElementsByTagName("img")
For Each curElement As HtmlElement In col
If curElement.GetAttribute("src").Equals("/images/skip_ad/en.png") Then
curElement.Focus()
curElement.InvokeMember("click")
End If
Neither of them work. Is there another way to click the picture? If so could someone please explain?
Thanks a ton!