【发布时间】:2014-05-03 02:42:56
【问题描述】:
您好,我正在使用simple_html_dom php 库从其他网站获取内容。
我有下面的html结构,
<h1 class="nik_product_title" style="color: #000;">
DSLR D7100
<span class="new_big_parent">
<span class="new_big_child">
<span class="new_big_child1">new</span>
</span>
</span>
</h1>
使用这个
@$html->find ( 'div[class=nik_block_product_main_info_component_inner] h1',0)->plaintext;
但我得到的输出是DSLR+D7100new
如何只获取第一个纯文本,即只需要获取DSLR D7100
【问题讨论】:
标签: php html-parsing simple-html-dom