Advertisement
simpleonline12345

Untitled

Jan 8th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Dim webClient As New System.Net.WebClient
  2.  
  3. Dim url As String = "yourPageURL"
  4. Dim htmlByte() As Byte
  5. htmlByte = webClient.DownloadData(url)
  6.  
  7. Dim htmlString As String
  8. htmlString = System.Encoding.UTF8.GetText(htmlByte)
  9.  
  10. ' Generally using Regexes for Parsing HTML is not a good idea, this is just an example, you would use something like HTMLAgilityPack for parsing.
  11.  
  12. Dim Matches() As MatchCollection = System.Text.RegularExpressions.Regex.Matches(htmlString, "<img.*?src\s*=\s*[""'](?<src>[^""']+)[""'].*?>", System.Text.RegularExpressions.Regex.RegexOptions.IgnoreCase);
  13.  
  14. For Each match As Match In Matches
  15. If (Not match.Groups("src").ToString().ToLower().Contains("captcha")) Then Continue For
  16.  
  17. PictureBox1.Image = New Drawing.Bitmap(New System.IO.MemoryStream(webClient.DownloadData(match.Groups("src").ToString())))
  18. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement