I want to click the following button using pyppeteer
<button class="r3f3s" tabindex="0">Text here</button>
I am trying to do it using Jquery
like suggested here:
btn = await page.querySelector('button[text=\'Text here\']')
or here:
btn = await page.querySelector('button:contains(text(), 'Text here'))
But it doesn't seem to work. I also noticed that a lot of examples published online in Jquery doesn't seem to work it Google chrome's console, thus doesn't work on pyppeteer
.
My question is how can I select button by its text, and also, can anyone direct me to a guide explaining what Jquery selector syntax is the right one to work on Google chrome's console (puppeteer)? because this one doesn't seem correct and this error is not really indicative:
Uncaught DOMException: Failed to execute 'querySelector' on 'Document': is not a valid selector.
at <anonymous>:1:10