其中express是服务端框架request相当于前端的ajax请求cheerio相当于jq 开始首先我们先新建一个 crawler目录执行 npm install express -g 命令 和 npm install express-generator -g ...
- 其中express是服务端框架
- request相当于前端的ajax请求
- cheerio相当于jq
开始 1 var express = require('express'); 2 var app = express(); 3 var request = require('request'); 4 5 app.get('/', function(req, res) { 6 request('http://www.cnblogs.com/galenyip', function (error, response, body) { 7 if (!error && response.statusCode == 200) { 8 console.log(body);// Show the HTML for the Google homepage. 9 res.send('hello express');10 }11 });12 });13 14 app.listen(3000, function() {15 console.log('listening on 3000');16 });
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:nodejs爬虫系统
关键词:JS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。