我一直在努力如何处理剧作家中的警报框,我正在关注此文档https://playwright.dev/python/docs/dialogs#alert-confirm-prompt-dialogs
这是我的代码片段
page.click('text=STOP BUTTON'); #Prompt appears are you sure you want to stop? xOK xCancel
page.on("dialog", lambda dialog: dialog.accept())
page.on("dialog", lambda dialog: print(dialog.message))
page.click("OK")
#page.click('text=OK')