0

I managed to get entire html from the URL using codes below but I only need a single div with class of "product-overview" and save it to database.

const request = require('request');
const cheerio = require("cheerio");

request('https://www.aliexpress.com/item/1005002976829559.html', (error, response, html) => {
  if (!error && response.statusCode == 200) {
    const $ = cheerio.load(html);
    const description = $('.product-overview');
   
    
    // how to filter <div class="product-overview"> .. </div>

    console.log(description.html());
  }
});

Current response is : null

  • That element isn't available in the static HTML. You'll need to use a dynamic scraper like Puppeteer or use their API, if possible. – ggorlen Dec 18 '21 at 18:12
  • Does this answer your question? [How can I scrape pages with dynamic content using node.js?](https://stackoverflow.com/questions/28739098/how-can-i-scrape-pages-with-dynamic-content-using-node-js) – ggorlen Dec 18 '21 at 18:13

0 Answers0