im trying to scrape a price element from a website using the page.evaluate
method, but it allways returns {} when i console.log
the result. here's the code:
const browser = await pptr.launch()
const page = await browser.newPage()
await page.goto("url")
const price = await page.evaluate(() => {
return document.querySelector("selector")
})
console.log(price) // returns {}
I've tried using page.$(selector)
too, it returns an array containing ElementHandle and bunch of other stuuf whitch i don't fully understand what they are
thanks!