Question

I have an input tag and I want to get the value inside of that tag. I tried selectsinglenode(//input/@value) and Attributes[] and getAttributename in DocumentNode of Agilitypack in C#, but they did not work.

<input type=hidden" value="S1" name="code1" />

I want to get the S1 value of this tag.

Was it helpful?

Solution

You can try with this code:

HtmlDocument.DocumentNode.SelectSingleNode("//input[@value]").Attributes["value"].Value;

Hope this helps,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top