首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iPhone解析<br /> with Hpple

iPhone解析<br /> with Hpple
EN

Stack Overflow用户
提问于 2010-11-04 15:07:01
回答 1查看 667关注 0票数 1

我正在使用hpple解析html:只有一个问题:

代码语言:javascript
复制
<div class="Fiche">
  <p>Every Sunday, our Chef proposes a buffet high in color.
  <br />
  <br />
  A brunch either classic or on a theme for special events (Hallowe&rsquo;en, autumn...). Each time, you will be surprised by new culinary suggestions. Unlimited champagne.<br />
  <br />
  Every Sunday at the restaurant <a target="_blank" href="http://www.montecarlobay.com/THE-BLUE-BAY.html">Le Blue Bay</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
  <br />
  <br />
  Information/ reservations : (377) 98 06 03 60
 </p>

我的代码是:

代码语言:javascript
复制
NSArray *array4Soustitre = [xpathParser search:@"//div [@class='Fiche']/p"];
TFHppleElement *ele= [array4Soustitre objectAtIndex:0];
NSLog(@"content is %@ ",[ele content]);

我得到的只是:Information/ reservations : (377) 98 06 03 60我想得到<p></p>之间的所有文本,除了<br />任何帮助,非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2011-09-10 06:47:44

尝试:

代码语言:javascript
复制
NSArray *array4Soustitre = [xpathParser search:@"//div [@class='Fiche']/p/text()"];
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4094539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档