-
Scrape product name, price, rating from Mercado Livre Brazil using Puppeteer?
To scrape the product name from Mercado Livre Brazil, you need to navigate to the product page and locate the element containing the title, typically found inside an h1 or span tag with a specific class. Puppeteer lets you extract this information after waiting for the page to load. You can use page.$eval() to grab the name once the content has been rendered.
const puppeteer = require('puppeteer'); (async () => { // Launch browser and open Mercado Livre product page const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); await page.goto('https://www.mercadolivre.com.br/product-page'); // Scrape the product name const productName = await page.$eval('h1[]', el => el.innerText); console.log('Product Name:', productName); await browser.close(); })();
Log in to reply.