-
How can I scrape product name, price, availability from BigC Thailand -Puppeteer
To scrape the product name from BigC Thailand, you’ll first need to navigate to the specific product page and then locate the element containing the product name. It’s usually found within an h1 or span tag. You can extract the product name by using Puppeteer’s page.$eval() method after making sure the page is fully loaded.
const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); await page.goto('https://www.bigc.co.th/en/product-page'); const productName = await page.$eval('.product-name', el => el.innerText); console.log('Product Name:', productName); await browser.close(); })();
Log in to reply.