我想通过simple_html_dom从下面的html行获取zumbai
,n
和something
:
<p>
<div align="left" style="margin: 0.00mm 0.00mm ;">
<p style="font-family: Arial; font-size: 1.0em;">
<b>zumbai</b>
<i>n</i> something
</p>
</div>
这是我的代码:
foreach($html->find('div.align') as $tag1) {
foreach($tag1->parent()->find('p.style') as $tag2){
$words1 = $tag2->first_child();
$words11= $words1->plaintext;
$words2 = $tag2->first_child()->first_child();
$words22= $words2->plaintext;
}
}
但它不起作用。谢谢你:))