【发布时间】:2011-07-26 19:15:57
【问题描述】:
我有一个 HTML 文档,例如:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="font-family: Geneva; color: rgb(0, 0, 0); font-size: 12px; word-wrap: break-word; font-weight: normal; font-style: normal; text-decoration: none; ">
<p style="font-family: LucidaGrande; color: rgb(51, 102, 204); margin-top: 6px; margin-bottom: 6px; word-wrap: break-word; font-weight: normal; font-style: normal; text-decoration: none; ">
fdskl says: (6:50:04 AM)
</p>
<p style="font-family: Arial-ItalicMT; color: rgb(0, 0, 0); margin-left: 36px; margin-top: 6px; margin-bottom: 6px; word-wrap: break-word; font-weight: normal; font-style: normal; text-decoration: none; ">
Hello
</p>
<p style="font-family: LucidaGrande; color: rgb(51, 102, 204); margin-top: 6px; margin-bottom: 6px; word-wrap: break-word; font-weight: normal; font-style: normal; text-decoration: none; ">
fdskl says: (6:50:18 AM)
</p>
<p style="font-family: Arial-ItalicMT; color: rgb(0, 0, 0); margin-left: 36px; margin-top: 6px; margin-bottom: 6px; word-wrap: break-word; font-weight: normal; font-style: normal; text-decoration: none; ">
How are you?
</p>
</body>
</html>
我想得到这个 HTML 的最后一个 p 标记中的任何内容。所以在这种情况下,它会是“你好吗?”。使用 Cocoa,我该怎么做? 谢谢!
【问题讨论】:
标签: html objective-c xml cocoa nsxmlparser