Imports System.Net
Imports System.IO
Imports System.Text

Imports HtmlAgilityPack

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim doc As New HtmlDocument()
        Dim secondForm As HtmlNode = doc.GetElementbyId("form2")
        For Each node As HtmlNode In secondForm.Elements("input")
            Dim valueAttribute As HtmlAttribute = node.Attributes("value")
            If valueAttribute IsNot Nothing Then
            End If

    End Sub
End Class

And here is my error code.


What I am trying to do is to navigate to a website and download all the inputs of the form on that page. Doesn't matter what website I use I can't get beyond this error code.

Any ideas?


Well,the error is saying it a nullException meaning your secondForm is empty or hasn't been loaded with anything.
This is probably because you are trying to match it with elements on the page called "form2". Are you sure they exist on the target page?