News Feed Forums General Web Scraping How can I scrape product features, price, promotions from Ponto Frio Brazil?

  • How can I scrape product features, price, promotions from Ponto Frio Brazil?

    Posted by Aston Martial on 12/12/2024 at 10:32 am

    To scrape product features from Ponto Frio Brazil, you can use Puppeteer to load the page and locate the div or ul tag containing the product features list. Use page.$$eval() to extract and map each feature into an array. This allows you to collect all product features efficiently.

    const puppeteer = require('puppeteer');
    (async () => {
        const browser = await puppeteer.launch({ headless: true });
        const page = await browser.newPage();
        await page.goto('https://www.pontofrio.com.br/product-page');
        // Scrape product features
        const features = await page.$$eval('.product-features li', items => 
            items.map(item => item.innerText.trim())
        );
        console.log('Product Features:', features);
        await browser.close();
    })();
    
    Monica Nerva replied 1 week, 2 days ago 3 Members · 2 Replies
  • 2 Replies
  • Jay Zorka

    Member
    12/13/2024 at 9:44 am

    To extract the price, use Puppeteer to target the element containing the pricing information, typically within a span or div. Ensure the element is loaded by waiting for the selector before extracting the text. This ensures accurate price scraping.

    const puppeteer = require('puppeteer');
    (async () => {
        const browser = await puppeteer.launch({ headless: true });
        const page = await browser.newPage();
        await page.goto('https://www.pontofrio.com.br/product-page');
        // Scrape price
        const price = await page.$eval('.product-price', el => el.innerText);
        console.log('Price:', price);
        await browser.close();
    })();
    
  • Monica Nerva

    Member
    12/13/2024 at 11:02 am

    To scrape promotions, locate the section where discounts or special offers are displayed. Use page.$eval() to extract the promotion text. This is often presented as a percentage discount or special note within the product section.

    const puppeteer = require('puppeteer');
    (async () => {
        const browser = await puppeteer.launch({ headless: true });
        const page = await browser.newPage();
        await page.goto('https://www.pontofrio.com.br/product-page');
        // Scrape promotions
        const promotions = await page.$eval('.product-promotion', el => el.innerText.trim());
        console.log('Promotions:', promotions);
        await browser.close();
    })();
    

Log in to reply.