How to Parse an input type in HTML form using C# HtmlAgilityPack

I have these HTML form in which am trying to get the input value

<form action="/checkout/cart" method="POST" class="update-qty-form">
    <div class="quantity num-selector">
        <input type="tel" value="1" name="qty" maxlength="3" class="quantity-increment">
    </div>
</form>

With the Code it doesn’t work

var Quantity = items
    .Elements("form").First()
    .Elements("div").First()
    .Elements("input").First().Attributes["value"].Value;
Debug.WriteLine("The Quantity is : " + Quantity);


Source: forms

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.