我想在HTML内容上添加一个字符串。我有下一个代码
<table>
<tr>
<td>hi</td>
</tr>
<tr class="pem">
<td>hello</td>
</tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>hi</td>
</tr>
<tr class="pem">
<td>hello</td>
</tr>
<td>1</td>
<td>2</td>
</tr>
</table>
所以,如果你看到,我需要把2&#34; tr&#34;关闭它。
我想我需要这样做:
for each node as htmlNode in doc.DocumentNode.SelectNodes("//tr[contains(@class,'pem')]")
//And here i want to make a appendchild to put only the "tr" to open it
node.appendChild("<tr>")
但它不起作用,因为我需要创建一个HTML节点或htmlElement