Bing Search Scraping

node v8.17.0
version: 1.0.0
endpointsharetweet
const cheerio = require('cheerio') const sf = require('snekfetch') const query = 'wallpaper' const locale = 'en' let html = (await sf.get(`https://www.bing.com/search?q=${query}`)).text const $ = cheerio.load(html) Array.from($('.b_algo')).map(r => ({ title: $('h2', r).text(), url: $('a', r).attr('href'), description: $('p', r).text(), rawDescription: $('p', r).html().replace(/&#x(\d+);/g, (_, cp) => String.fromCodePoint(parseInt(cp, 16))) }))
Loading…

no comments

    sign in to comment