我想使用簡單的HTML DOM來提取標籤內的類與「sitepoint」的一切。這裏是我的代碼無法正常工作:卡住簡單的Html Dom和提取信息
<?php
include_once('simple_html_dom.php');
$html = file_get_html('examplewebsite');
$ret = $html->find('.sitepoint');
echo $ret;
?>
下面是sitepoint標籤之一的例子(有十個左右)裏面,我想要的信息。
<dl class="sitepoint">
<dd class="thumbnail">
<a href="blabla" ></a><a href="/toolbar/sidepanel.php?url=random.html" >Get This Now</a> </dd><dt class="notext"><a href="/to/" >Title</a></dt><dd class="starts">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td class="textUncolor"> CUT OUT SOME IMAGES AND ADDRESSES HERE
</td></tr>
</table>
</dd>
誰能幫我得到它的工作?
+1不嘗試使用正則表達式。 ;) – TrueWill 2009-10-05 21:42:10