My element.click() is not working on Puppeteer!
I came across this issue recently and just wanted to share my solutions (yes, more than one).
The page's zoom
For some reason I changed the default zoom, over 100% and below 100% too, but I didn't realize I did that. The simplest solution here was just to return the zoom to 100%.
await element.evaluate(e => e.click())
For some reason the method await element.click()
doesn't work when the page's zoom is not 100%. Because of that I had to use the second method of clicking a button, which I don't find very reliable.
await element.evaluate(e => e.click())
Oh, I connected to
chrome
usingpuppeteer.connect
instead ofpuppeteer.launch
.
dptoledo@pm.me