質問

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.

役に立ちましたか?

解決

You can try with this code:

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

Hope this helps,

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top