嗨,我使用simple_html_dom
php库从其他网站获取内容。Html Dom解析器获取第一个元素
我有以下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
太简单了!没有意识到这一点。谢谢pguardiario。 – Vind
感谢@pguardiario这个非常简单的答案 – Gunaseelan
@pguardiario您对[this]有任何想法吗?(http://stackoverflow.com/questions/22669373/php-simple-html-dom-parser-cant-get-content-上分页) – Vind