I have another doubt with puppeteer, with this code I made click on this element. It is any possibility to check if element exists. I am interested to made click always if element exists.
await page.evaluate(() => {
const xpath = '//*[@id="detail"]/div[6]/div[2]/div[1]/div[3]';
const result = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE, null);
result.iterateNext().click();
});