Webbrowser get element

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Webbrowser get element
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;
https://t.me/pump_upp
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Webbrowser get element
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
2 posts Page 1 of 1
Return to “Coding Help & Support”