Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim webClient As New System.Net.WebClient
- Dim url As String = "yourPageURL"
- Dim htmlByte() As Byte
- htmlByte = webClient.DownloadData(url)
- Dim htmlString As String
- htmlString = System.Encoding.UTF8.GetText(htmlByte)
- ' Generally using Regexes for Parsing HTML is not a good idea, this is just an example, you would use something like HTMLAgilityPack for parsing.
- Dim Matches() As MatchCollection = System.Text.RegularExpressions.Regex.Matches(htmlString, "<img.*?src\s*=\s*[""'](?<src>[^""']+)[""'].*?>", System.Text.RegularExpressions.Regex.RegexOptions.IgnoreCase);
- For Each match As Match In Matches
- If (Not match.Groups("src").ToString().ToLower().Contains("captcha")) Then Continue For
- PictureBox1.Image = New Drawing.Bitmap(New System.IO.MemoryStream(webClient.DownloadData(match.Groups("src").ToString())))
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement