문제

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