0
我有一些HTML代码存储到一个字符串变量,从HttpWebRequest
导致:删除HTML节点
<html>
<head>
<div>Lots of scripts and libraries</div>
</head>
<body>
<div>Some very useful data</div>
</body>
<footer>
<div>Not interesting struff</div>
</footer>
<html>
我该怎么做才能消除所有unecesary节点,进入这样的:
<body>
<div>Some very useful data</div>
</body>
我会添加“最好”以及“最简单”的方式。用手解析html比看起来更难。 – dman2306
伟大的解决方案!现在我有我想要的东西。另外,这个快速教程补充了Robert的回答:http://www.w3schools.com/xsl/xpath_syntax.asp –