-
How can I scrape product name, price, rating from HomePro Thailand -Puppeteer?
To scrape the product name from HomePro Thailand, you can use Puppeteer to extract the text from the specific HTML element that contains the name. Usually, the product name is located within a div or span tag. Using page.$eval() after ensuring the page has fully loaded will allow you to extract the product name easily.
const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); await page.goto('https://www.homepro.co.th/en/product-page'); const productName = await page.$eval('.product-title', el => el.innerText); console.log('Product Name:', productName); await browser.close(); })();
Log in to reply.