1.1.1 • Published 11 months ago
@jswork/next-model-douban-book v1.1.1
next-model-douban-book
Douban book model for next.
installation
yarn add @jswork/next-model-douban-bookusage
import cheerio from "cheerio";
import "@jswork/next-model-douban-book";
fetch("https://book.douban.com/subject/25941890/")
.then((res) => res.text())
.then((res) => {
var $ = cheerio.load(res, { decodeEntities: false });
var model = new nx.ModelDoubanBook({ $ });
var res = model.gets();
console.log("res: ", res);
expect(res.title).toBe("海伯利安");
});license
Code released under the MIT license.