0

so i use for loop to change page like website/page=1, example

For i As Integer = NumericUpDown1.Value To NumericUpDown2.Value
    Pnumber = i
    Scrape()
Next

and

 Dim base As String = ComboBox1.Text & Pnumber
    Dim Webget = New HtmlWeb()
    Dim doc = Webget.Load(base)
    For Each node As HtmlNode In doc.DocumentNode.SelectNodes("//tbody//td//a[contains(@href, 'player')]")
        If Not ListBox1.Items.Contains(node.InnerHtml) Then
            ListBox1.Items.Add(node.InnerHtml)
        End If
    Next
    Label2.Text = "Count: " & ListBox1.Items.Count

first few pages work, but it throws exception, how can i change page other way idk... or wait it to finish scraping ? oh and i can use sleep but it slows down the process.

It wont help you but:

An unhandled exception of type 'System.NullReferenceException' occurred in scraper 2.exe Additional information: Object reference not set to an instance of an object.

It throws error in this line For Each node As HtmlNode In doc.DocumentNode.SelectNodes("//tbody//td//a[contains(@href, 'player')]")

newbhere
  • 1
  • 1

0 Answers0