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