我正在使用PHP Simple HTML DOM开发剪贴簿应用程序。
下面是html结构,我们需要获取城市/州名称。 它" Daviston,AL "在下面的例子中。有谁能请帮助我。
<div class="post-entry">
<h2 class="entry-title">
<a title="Horseshoe Bend National Military Park" href="http://www.parks.us/id-2755/">Horseshoe Bend National Military Park</a>
</h2>
<strong>City/State: </strong> Daviston, AL
<p><span><em>Activities include:</em> Auto Touring, Biking, Boating, Fishing, Hiking, Picnicking, Water Sports, Wildlife Viewing</span></p>
</div>
使用此代码,我刚刚获得&#34; 城市/州&#34;
foreach($html->find('div[class=post-entry]') as details){
$Details->find('strong',0)->plaintext
}
答案 0 :(得分:0)