可能重复:
Xpath not behaving for me in parsing basic html如何使用正则表达式检索DIV的内容?
我知道如何从静态的名字一个div(即总是在整个页面相同)获取内容。然而,我的情况是“post_id_xxxxx”,这样的事情:
<div id="post_id_12345">abc</div>
<div id="post_id_67890">abc</div>
<div id="post_id_31234">abc</div>
我想提取“ABC”字符串,但似乎很难给我,因为每一个div有不同的ID。
谢谢。
你不知道。 [时段](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)。 – delnan 2011-03-13 22:03:24
[Xpath不能在解析基本html时为我工作](http://stackoverflow.com/questions/5249492/xpath-not-behaving-for-me-in-parsing-basic-html)。注意对接受答案的评论。如果您只是懒得使用搜索功能,您应该能够找到很多其他重复项。 – Gordon 2011-03-13 22:13:18