Вопрос

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