【发布时间】:2018-03-22 08:22:34
【问题描述】:
我正在使用 HtmlDocument 和 HtmlWeb。我通常使用以下方式通过其 id 获取表单元素:
HtmlDocument doc = new HtmlDocument();
//get the form
doc.LoadHtml(htmlPreviousForm);
var form = doc.GetElementbyId("postingForm");
但是,我正在使用我想要的表单的页面没有名称、ID 或类:
<form action="test.php" method="post">
<button type="submit" name="go" value="[x]" title="delete">x</button>
</form>
如何使用 HtmlDocument 获取此表单的操作?
【问题讨论】:
-
那里有很多表格吗?
-
不,只有一种形式
-
为什么不在表单中添加名称?