0
我正在使用简单的html dom。我有这个代码:简单的html dom移除元素的错误
<html>
<div class="one">
<div class="two">this is inner text </div>
<a href="#" class="three">this is inner anchor</a>
This is outer test
</div>
</html>
我想要取This is outer test
只。 这里是我的代码:
$html = file_get_html(SITE_URL.'/forumlist.php');
$html->find('.two',0)->outertext = "";
$html->find('.three',0)->outertext = "";
$html->save();
echo $html->find('.one',0)->plaintext;
和我失望..
你得到了什么错误? – Peon 2013-02-11 08:21:27
我得到了一切..'这是内心的文字,这是内部锚点这是外部测试' – 2013-02-11 08:23:07