const axios = require('axios');
const jsdom = require('jsdom');
const {JSDOM} = jsdom;
(async () => {
const html = await axios.get('https://mangadex.org/titles/latest');
const dom = new JSDOM(html.data);
const title = dom.window.document.querySelectorAll(".chapter-feed__container a div img")[0].src;
if(title) {
console.log(title);
}
})();
I tried above code to get the image url from the website above but it always throws error which I don't know the cause is when I tried scrapping first using console I was successfully here is the code I used in console scrapping
var cc=document.querySelectorAll(".chapter-feed__container a div img")[0].src;
cc;
Any suggestions regarding the matter would be of great help. About node.js libraries yes I have them all installed and it's working perfectly.