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!

Is this another "cheat the world so I can make a few pennies auto.clicking links" thread?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.