1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

html agility pack ~ how can I get all inputs of a form~ error code given

Discussion in 'Black Hat SEO' started by simpleonline1234, Dec 4, 2011.

  1. simpleonline1234

    simpleonline1234 Junior Member

    Joined:
    Jan 26, 2010
    Messages:
    169
    Likes Received:
    13
    Code:
    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
            HtmlNode.ElementsFlags.Remove("form")
            Dim doc As New HtmlDocument()
            doc.LoadHtml("http://mywebsiteishere/")
            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
                    Console.WriteLine(valueAttribute.Value)
                End If
            Next
    
    
    
    
    
        End Sub
    End Class

    And here is my error code.

    [​IMG]

    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?

    Thanks