我正在尝试使用简单的 HTML DOM 来捕捉这个分页的最后一部分。这部分:
<a class="paginationNumberStyle page_arrows" data-url="**/Building-Materials/h_d1/N-5yc1vZ25ecodZaqns/h_d2/Navigation?catalogId=10053&Nu=P_PARENT_ID&langId=-1&Nao=96&storeId=10051**">
<div class="page-nav">
<span>1</span>
<a class="paginationNumberStyle" data-url="/Building-Materials/h_d1/N-5yc1vZ25ecodZaqns/h_d2/Navigation?catalogId=10053&Nu=P_PARENT_ID&langId=-1&Nao=96&storeId=10051">
2
</a>
<a class="paginationNumberStyle" data-url="/Building-Materials/h_d1/N-5yc1vZ25ecodZaqns/h_d2/Navigation?catalogId=10053&Nu=P_PARENT_ID&langId=-1&Nao=192&storeId=10051">
3
</a>
<a class="paginationNumberStyle" data-url="/Building-Materials/h_d1/N-5yc1vZ25ecodZaqns/h_d2/Navigation?catalogId=10053&Nu=P_PARENT_ID&langId=-1&Nao=288&storeId=10051">
4
</a>
<a class="paginationNumberStyle" data-url="/Building-Materials/h_d1/N-5yc1vZ25ecodZaqns/h_d2/Navigation?catalogId=10053&Nu=P_PARENT_ID&langId=-1&Nao=384&storeId=10051">
5
</a>
<a class="paginationNumberStyle page_arrows" data-url="/Building-Materials/h_d1/N-5yc1vZ25ecodZaqns/h_d2/Navigation?catalogId=10053&Nu=P_PARENT_ID&langId=-1&Nao=96&storeId=10051">
<img alt="" src="/static/images/layout/triangle-green-right.gif"></a>
</div>
这是我的代码:
if ($nextPage = $dom->find('a[class=paginationNumberStyle.page_arrows]', 0)) {
echo $nextPage->href;
我也试过:
if ($nextPage = $dom->find('a[class=paginationNumberStyle.page_arrows]', 0)) {
我远不是简单 HTML DOM 方面的专家,我希望有人知道一个快速的答案。我想知道是不是因为数据网址?