Hi,
I am trying to open the latest email in Gmail and click on one of the click. But I am unable to.
Here are steps using Puppeteer ,
- Login into GMAIL, ---- Successful
2.Search for the "Unread email with the text"- Successful
- Now using xPath trying to click on the latest email but failing,
Below is the code
await page.waitForXPath('//[@Class="zA zE"]');
const [emails] = await page.$x('//[@Class="zA zE"]');
if(emails)
{
await Promise.all([
await page.waitForNavigation(),
emails.click()
])
}
it says TypeError: Cannot read property 'click' of undefined
Could anyone please help me with this.