cheerio ==> node中的jquery

三.cheerio ==> node中的jquery  https://www.npmjs.com/package/cheerio

$ npm install cheerio -- save

1.cheerio.load ==> 加载HTML文档

const request = require('superagent')
const cheerio = require('cheerio')
const fs = require('fs-extra')
const path = require('path') const url = "https://tieba.baidu.com/p/4885218336?see_lz=1&pn=1";
async function getUrl() {
const res = await request.get(url);
const $ = cheerio.load(res.text);
}
getUrl();
上一篇:iOS与HTML5交互方法总结(修正)


下一篇:HDU 1533 Going Home (最大权完美匹配)