Good day, I'm currently building a scraper and have a few questions. I've already built in threading etc. so that everything works faster in the code, but everything runs too slowly for me.
Public Sub ScrapeProxyDo(address As String)
Dim wc As New Net.WebClient
Dim matchCollection As MatchCollection
Try
Dim input As String = wc.DownloadString(address)
matchCollection = REGEX.Matches(input)
'ncihts
For Each obj As Object In matchCollection
Dim match As Match = CType(obj, Match)
Dim item As String = match.ToString()
RichTextBox2.AppendText(item & Environment.NewLine)
Next
Catch ex As Exception
'Nichts
End Try
End Sub
The code is relatively simple, it checks whether the page contains an IP with a port, the regex for it is: Dim REGEX As Regex = New Regex("\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\:[0-9]{1,5}\b")
But now he takes from the string what is downloaded, each proxy individually and of course that takes time, can you maybe change it somehow so that he filters out all proxies and inserts them directly into the RichTextBox? That would be much faster than if he worked his way slowly from bottom to top.
Regards