Guest User

Untitled

a guest
Jan 4th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. Dim source As String = New
  2. System.Net.WebClient().DownloadString("http://pagewantingtouse.com")
  3.  
  4. <div class="description">
  5. The Amazing Spider-Man is a 2012 American superhero film based on the Marvel
  6. Comics character Spider-Man. It is the fourth installment of the Spider-Man film series, serving
  7. as a reboot.
  8. </div>
  9.  
  10. Dim request As WebRequest = WebRequest.Create("http://pagewantingtouse.com") 'create a web request to the html file
  11. Using response As WebResponse = request.GetResponse() 'get the response back from the request
  12. Using Reader As New StreamReader(response.GetResponseStream) 'identify how you want to read the response and assign it to streamreader
  13. Dim webtext As String = Reader.ReadToEnd() 'read the response (web page) as a string to the end of the file
  14.  
  15. Dim wbc As WebBrowser = New WebBrowser() 'create a web browser to handle the data. this will help sift through it
  16.  
  17. wbc.DocumentText = ""
  18.  
  19. With wbc.Document
  20. .OpenNew(True)
  21. .Write(webtext) 'write the web page response into the web browser control
  22.  
  23.  
  24. Dim itemlist As HtmlElementCollection = .GetElementsByTagName("DIV")
  25.  
  26. For Each item In itemlist 'look at each item in the collection
  27. If item.classname = "description" Then
  28. msgbox item.innertext 'this would msgbox your description
  29. Exit For 'exit once found
  30. End If
  31.  
  32.  
  33.  
  34. Next 'do this for every item in the collection until we find it
  35.  
  36. End With
  37.  
  38. wbc.dispose()
  39.  
  40. End Using
  41.  
  42. End Using
Advertisement
Add Comment
Please, Sign In to add comment