我是 c# 和 htmlagilitypack 的新手,我一直在尝试获取 signup_form_id 的值,即 2079787163
<form name="setupform" id="setupform" method="post" action="/signup/" target="_top">
<input type="hidden" name="form_type" value="blog" />
<input type="hidden" name="stage" value="" />
<input type="hidden" name="loc" value="signup" />
<input type='hidden' name='signup_form_id' value='2079787163' /><input type="hidden" id="_signup_form" name="_signup_form" value="9783b65654" />
这是我的编码
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
doc.Load("https://signup.wordpress.com/signup/");
var value = doc.DocumentNode.SelectSingleNode("//form[@name='signup_form_id'");
Console.WriteLine(value.InnerText);
我知道我的 xpath 表达式确实有问题,我对此一无所知。哪位好心人能给点建议?非常感谢!