HTML部分:使用XPath檢索元素
<div class="abc">
<div style="text-align:left; itemscopr itemtype="xyz">
<h1 itemtype="mno"> I want this text </h1>
</div>
</div>
我使用
$text = $xpath->query('//div[class="abc"]/div/h1]
,但我越來越沒有價值。請幫助我,因爲我是新手。
也許你錯過了文本()[1]在結束 – mlwacosmos 2013-03-06 16:47:29