I try to write a webscraper with the Puppeteers library. It worked properly on amazon.com - but with another page (coinhall.org) I get an error that I can't resolve. Can anyone point me in the right direction here?
const [el2] = await page.$x('//*[@id="root"]/div/div[4]/div/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]');
const txt = await el2.getProperty('textContent');
const rawTxt = txt.jsonValue();
Error:
const txt = await el2.getProperty('textContent');
^
TypeError: Cannot read properties of undefined (reading 'getProperty')
Seems as if el12 doesn't get its value somehow, right? Double checked the XPATH, it's correct though.