【发布时间】:2012-04-20 17:34:46
【问题描述】:
我有一堆 html 文件,我需要从中提取文本,而不是列表的内容。 html就像
<html>
<Head>
<title>intranet mycompany</title>
</head>
<body>
<div>blah</div>
<p>the text i need to extract
<br>
<ul>
<li>stuff i don't want.</li>
<li>more stuff i don't want.</li>
</ul>More text i need to exctract.</p>
</body>
</html>
我真的想要一些关于如何从段落中获取文本而不是从列表中获取文本的建议。任何建议都会被采纳。
问候, 乔博。
【问题讨论】:
-
顺便说一句,这不是 HTML。在 HTML 中,UL 元素不能出现在 P 元素内部。
-
@casperOne - 当您(作为版主)删除其他答案时,请非常友好并以确切的理由对该答案添加评论。谢谢!