![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
node.js
hello、深海鱼
这个作者很懒,什么都没留下…
展开
-
node爬虫(二)
1.如何安装 要通过js写爬虫,需要用到三个模块,request、cheerio和fs,其中fs内置了,只需要安装前两个即可,安装命令: npm install request cheerio 2.获取网页内容 request会向回调函数传递三个参数,分别是error(错误信息),response(响应信息),body(网页内容): var request =require('request')...原创 2020-04-10 21:21:21 · 155 阅读 · 0 评论 -
node爬虫(一)
目录结构如下: var http =require('http'); var fs =require('fs'); var curentPage=1; //当前图片页数 var maxcurentPage=5;//最大页数 //获取图片地址 function getData(){ let url = 'http://www.nipic.com/photo/xiandai/jia...原创 2020-02-18 18:07:49 · 119 阅读 · 0 评论