1
我需要從以下獲得href屬性:從網頁獲取href屬性?
<tr>
<td><h2 class="officers"><a href="/finance/stocks/officerProfile?symbol=ABB.N&officerId=232795" class="link">Roger Agnelli</a></h2></td>
<td>53</td>
<td>2002</td>
<td>Non-Executive Member of the Board of Directors</td>
</tr>
什麼我想這裏是
$a = $tr->getElementsByTagName('a');
echo $a->getAttribute('href');
無法獲得HREF value.where我失蹤?我需要在這裏我想要輸出href鏈接,然後解析href鏈接到'官員id'。
希望我很清楚我的問題..幫助我..
你會得到什麼? – Leri
未定義的方法DOMNodeList :: getAttribute() – user1518659