Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim source As String = New
- System.Net.WebClient().DownloadString("http://pagewantingtouse.com")
- <div class="description">
- The Amazing Spider-Man is a 2012 American superhero film based on the Marvel
- Comics character Spider-Man. It is the fourth installment of the Spider-Man film series, serving
- as a reboot.
- </div>
- Dim request As WebRequest = WebRequest.Create("http://pagewantingtouse.com") 'create a web request to the html file
- Using response As WebResponse = request.GetResponse() 'get the response back from the request
- Using Reader As New StreamReader(response.GetResponseStream) 'identify how you want to read the response and assign it to streamreader
- Dim webtext As String = Reader.ReadToEnd() 'read the response (web page) as a string to the end of the file
- Dim wbc As WebBrowser = New WebBrowser() 'create a web browser to handle the data. this will help sift through it
- wbc.DocumentText = ""
- With wbc.Document
- .OpenNew(True)
- .Write(webtext) 'write the web page response into the web browser control
- Dim itemlist As HtmlElementCollection = .GetElementsByTagName("DIV")
- For Each item In itemlist 'look at each item in the collection
- If item.classname = "description" Then
- msgbox item.innertext 'this would msgbox your description
- Exit For 'exit once found
- End If
- Next 'do this for every item in the collection until we find it
- End With
- wbc.dispose()
- End Using
- End Using
Advertisement
Add Comment
Please, Sign In to add comment