我试图刮一个网站与多个网页。我想构建一个函数,返回一组页面中的页数。在
这是一个起始页示例。在
前导页中有29个子页,理想情况下函数将返回29。在
我的意思是,第1页,共29页,第2页,共29页等等
这是一个HTML代码片段,其中包含来自上面发布的链接的最后一页信息。在
<div id="paging-wrapper-btm" class="paging-wrapper">
<ol class="page-nos"><li ><span class="selected">1</span></li><li ><a href='http://www.asos.de/Herren-Jeans/podlh/?cid=4208&pge=1&pgesize=36&sort=-1'>2</a></li><li ><a href='http://www.asos.de/Herren-Jeans/podlh/?cid=4208&pge=2&pgesize=36&sort=-1'>3</a></li><li ><a href='http://www.asos.de/Herren-Jeans/podlh/?cid=4208&pge=3&pgesize=36&sort=-1'>4</a></li><li ><a href='http://www.asos.de/Herren-Jeans/podlh/?cid=4208&pge=4&pgesize=36&sort=-1'>5</a></li><li #LIVALUES#>...</li><li ><a href='http://www.asos.de/Herren-Jeans/podlh/?cid=4208&pge=28&pgesize=36&sort=-1'>29</a></li><li class="page-skip"><a href='http://www.asos.de/Herren-Jeans/podlh/?cid=4208&pge=1&pgesize=36&sort=-1'>Weiter »</a></li></ol>
我有下面的代码,可以找到所有的ol标记,但无法找到如何访问每个'a'中包含的内容。在
^{pr2}$非常感谢您的任何帮助/建议。在
试试这个:
啊。。我找到了一个简单的解决办法。在
然后我可以排序并选择最大的数字。在
以下内容将提取最后一页的编号:
您的网站将显示:
^{pr2}$相关问题 更多 >
编程相关推荐