I've written this whole code to extract cell numbers from a website. It is extracting numbers perfectly but very slowly, and it's also hanging my Form while Extracting.Imports HtmlAgilityPackImports System.Text.RegularExpressionsPublic Class ExtractorShared doc As New HtmlAgilityPack.HtmlDocument()Public Shared Function ScrapLinks(TextBox1 As TextBox, ListBox1 As ListBox, lbllinks As Label)Dim hw As New HtmlWeb()Try    doc = hw.Load(TextBox1.Text)    doc.LoadHtml(doc.DocumentNode.SelectSingleNode(//*[@id='ad_list']).InnerHtml())    For Each link As HtmlNode In doc.DocumentNode.SelectNodes(//a[@href])        Dim hrefValue As String = link.GetAttributeValue(href, String.Empty)        If hrefValue.Contains(/detail/) Then            If Not ListBox1.Items.Contains(hrefValue) Then                ListBox1.Items.Add(hrefValue)            End If        End If    NextCatch ex As Exception    MsgBox(Error  + ex.Message)End TryReturn NothingEnd FunctionPublic Shared Function Scrapnums(lstbox As ListBox,lstnum As ListBox)Try    Dim hw As New HtmlWeb()    doc = hw.Load(lstbox.SelectedItem)    Dim data = doc.DocumentNode.SelectSingleNode(//*[@class='det_ad f_left']).InnerText    Dim m As Match = Regex.Match(data, (\+92|0092)-?\d{3}-?\d{7}|\d{11}|\d{4}-\d{7})    If Not lstnum.Items.Contains(m.Value) Then        lstnum.Items.Add(m.Value)    End IfCatch ex As ExceptionEnd TryReturn NothingEnd FunctionEnd Class
Phone Number Extracting using RegEx And HtmlAgilityPack
performance;regex;vb.net;web scraping