使用Web-Harvest抓取分页的数据
可以利用其自带的例子里面已经写好了的那个函数,在Functions.xml文件里面,只要
在配置文件的开头把include进来就行了;
Functions.xml文件如下:
其里面的各个参数的意义:
<!--
Download multi-page list of items.
@param pageUrl - URL of starting page
@param itemXPath - XPath expression to obtain single item in the list
@param nextXPath - XPath expression to URL for the next page
@param maxloops - maximum number of pages downloaded
@return list of all downloaded items
-->
第一个是指开始的那个页面的URL;
第二个是指你要在页面里面取得的一个list,比如说是href的List或者说是一个tr的
List,我下面的例子就是取得一个tr的List;
第三个是指下一个页面的URL;
第四个是指循环查找的页数;
这就是我所写的配置文件: