I am using cheerio to scraper data off a page and when I try to get the img src it gives me a weird output.
const cheerio = require("cheerio")
require('isomorphic-fetch');
function scrapeAll(){
nikeScraper()
}
async function nikeScraper(){
const data = {}
const url = "https://www.nike.com/w/sale-shoes-3yaepzy7ok"
const response = await fetch(url)
const html = await response.text()
const $ = await cheerio.load(html)
const title = $(".product-card__title").each((index, el) => {
const item = $(el).text()
data[index] = {}
data[index].title = item
})
const price = $(".product-price__wrapper").each((index, el) => {
const item = $(el).text().trim().split("$")
data[index].sale = item[1]
data[index].retail = item[2]
})
const link = $(".product-card__img-link-overlay").each((index, el) => {
const item = $(el).attr("href")
data[index].link = item
})
const img = $("img").attr("src")
console.log(img)
//console.log("Nike", data)
}
scrapeAll()
This is the console.log(img) output.
data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D
All the other data comes out as it should but this is not giving the src for some reason.