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推荐答案CSS 选择器包含当前不支持的文本,但您可以使用 XpathCSS selector contain text currently not supported but you can use Xpath完全匹配文本btn = await page.$x('//button[text()="Text here"]')包含文本btn = await page.$x('//button[contains(text(), "Text he")]')演示: 这篇关于在 Pyppeteer (Python Puppeteer) 中通过文本选择按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-29 15:09
查看更多