I'm trying to click the 3 dots on gmail here:
1
And then click the 'mark all as read': 2
I click on the 3 dots fine.
However I cannot click on the mark all as read.
I can select it when i inspect element by: div[class="J-M aX0 aYO jQjAxd"] > div[class="SK AX"] > div[class="J-N"]:nth-child(1)
However i cannot click it
I have tried:
A normal .click the selector
.focus then .click the selector
moving my mouse over the selector then clicking where the mouse is
hard waits before clicking
different selectors
etc
var selector = 'span[class="asa bjy"]'
await cursor.move(selector)
await cursor.click()
await page.waitForNavigation({ waitUntil: "networkidle2" })`
This prior part is fine (uses ghost-cursor), it clicks on the 3 dots. But the following does not work
await page.waitFor(1500)
var selector = 'div[class="J-M aX0 aYO jQjAxd"] > div[class="SK AX"] > div[class="J-N"]:nth-child(1)'
await page.waitForSelector(selector);
await page.click(selector);
Any advice welcome. Please let me know if i need to add more detail.
question from:
https://stackoverflow.com/questions/65939575/puppeteer-cant-click-div-in-gmail 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…