Cheerio.js 介绍
cheerio 是nodejs特别为服务端定制的,能够 快速 灵活的对JQuery核心进行实现。它工作于DOM模型上,且解析、操作、呈送都很高效。??
cheerio? 特点 ?
熟悉的语法:cheerio实现了jQuery核心的 一个 子集。 cheerio 删除 了从jQuery库中和不同浏览器不一致的东西,揭示其真正华丽的API。极快:cheerio适用于 一个 非常简单的,一致的DOM模型。 这样解析,操作和呈现是令人难以置信的高效率。灵活性:cheerio可以解析几乎所有的html或XML文档。
cheerio安装
npm install cheerio
cheerio使用
const cheerio = require('cheerio')
const $ = cheerio.load('<h2 class="title">Hello world</h2>')
$('h2.title').text('Hello there!')
$('h2').addClass('welcome')
$.html()
//=> <h2 class="title welcome">Hello there!</h2>
?
网站地址 : https://cheerio.js.org/
GitHub: https://github.com/cheeriojs/cheerio
网站描述: 是nodejs特别为服务端定制的,能够 快速 灵活的对JQuery核心进行实现
Cheerio.js官方网站
官方网站: https://cheerio.js.org/
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did177361