Page 1 of 1

Webbrowser get element

Posted: Wed Dec 19, 2012 12:00 am
by AnoPem
I have a webbrowser i want it to retrive some text from imdb the user put in the link and i should find whats about the movie

heres the link i use
http://www.imdb.com/title/tt1764651/

i want it to show this text in a textbox
Mr. Church reunites the Expendables for what should be an easy paycheck, but when one of their men is murdered on the job, their quest for revenge puts them deep in enemy territory and up against an unexpected threat.
Can anyone help me out dunnno;

Re: Webbrowser get element

Posted: Wed Dec 19, 2012 12:19 am
by comathi
You could put the following in your WebBrowser DocumentCompleted event.
Code: Select all
Dim elementList As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("p")
        For i = 0 To elementList.Count - 1
            If elementList(i).GetAttribute("itemprop") = "description" Then
                TextBox1.Text = elementList(i).InnerText
            End If
        Next