我正在使用hpple解析html:只有一个问题:
<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’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> <br />
<br />
<br />
Information/ reservations : (377) 98 06 03 60
</p>我的代码是:
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 />任何帮助,非常感谢!
发布于 2011-09-10 06:47:44
尝试:
NSArray *array4Soustitre = [xpathParser search:@"//div [@class='Fiche']/p/text()"];https://stackoverflow.com/questions/4094539
复制相似问题