im trying to figure out how to web scrape the price of a product into google sheets. Before i would use =importrange(A1,B1)
you can do it by this way
function bestbuy(source) {
const obj = JSON.parse(source);
const v = obj.offers.offers;
const header = Object.keys(v[0]);
return [header, ...v.map(o => header.map(h => Array.isArray(o[h]) ? o[h].join(",") : o[h]))];
}
In walmart, the situation is quite different, you have also a json but you can't fetch through google since there is a captcha.