我需要识别每个节点并删除某些节点,例如P
,legend
等等。需要使用 HTMLAgilityPack 遍历以下 html,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><META content="IE=5.0000" http-equiv="X-UA-Compatible">
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
</HEAD>
<BODY bgcolor="white"><text><TITLE>ABCD</TITLE>
<P style="page-break-before: always;">
<HR width="100%" size="3" align="CENTER" style="color: rgb(153, 153, 153);">
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text"><br>
Email: <input type="text"><br>
Date of birth: <input type="text">
</fieldset>
<P style="margin-top: 0px; margin-bottom: 0px;"><FONT size="1"> </FONT></P>
<P align="center" style="margin-top: 0px; margin-bottom: 0px;"><FONT size="2"
style="font-family: Times New Roman;">B-17 </FONT></P></text>
</BODY></HTML>