-
Scrape product name, price, and availability Robinson Thailand using Puppeteer?
To scrape the product name from Robinson Thailand, you need to open the product page and wait for the relevant element to load. The product name is usually located in an h1 or div tag with a specific class. Use page.$eval() to extract the name text once the page has finished loading.
const puppeteer = require('puppeteer'); (async () => { // Launch browser and open page const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); await page.goto('https://www.robinson.co.th/product-page'); // Scrape product name const productName = await page.$eval('.product-title', el => el.innerText); console.log('Product Name:', productName); await browser.close(); })();
Log in to reply.