“Cheerio” Ответ

Cheerio

var request = require('request'), cheerio = require('cheerio');

//Загружаем страницу
request({uri:'http://www.amazon.com/', method:'GET', encoding:'binary'},
function (err, res, page) {
//Передаём страницу в cheerio
var $=cheerio.load(page);
//Идём по DOM-дереву обычными CSS-селекторами
img_src=$('div.s9a3 > div > div > a > div > div > img').attr("src");
console.log(img_src);
});
Super Sardine

Пример Cheerio

const cheerio = require('cheerio');

let $ = cheerio.load(<body>);
let title = $('title');
console.log(title.text());
PerryGamerPT

Ответы похожие на “Cheerio”

Смотреть популярные ответы по языку

Смотреть другие языки программирования