Selenium+Python允许Firefox通知

2024-05-06 19:32:01 发布

您现在位置:Python中文网/ 问答频道 /正文

在这种情况下,如何实现Selenium就解决了这样一个问题 像这张照片这样的通知 https://prod-cdn.sumo.mozilla.net/uploads/gallery/images/2017-10-18-05-45-38-20e1d7.png

希望他能督促自己我会非常感激的


Tags: httpsmozillanetpngselenium情况cdnprod
1条回答
网友
1楼 · 发布于 2024-05-06 19:32:01

使用以下代码:

profile = webdriver.FirefoxProfile()
profile.set_preference('permissions.default.desktop-notification', 1)
driver = webdriver.Firefox(firefox_profile=profile)

相关问题 更多 >