1.0.2 • Published 6 years ago
fastagency v1.0.2
FastAgency
简介
一个爬取IP代理地址的小模块,使用了crawler。
使用方法
const fa = require('fastagency');
//爬取5页IP,间隔为2000毫秒,返回JSON,并保存到本地
fa.update(5,(ips)=>{
console.log(ips);
}
,2000);
//读取本地JSON
fa.getAgency(null,(ips,filePath)=>{
console.log(filePath);
console.log(ips);
});
注意事项
- 爬取间隔不要太短,会导致爬取不到数据。
- 爬取的数据已经保存在本地,更新IP需要比较长的时间