我正在使用Python运行seleniumwebdriver,并尝试在Safari中禁用浏览器推送通知。我已经能够在我的Chrome和Firefox设置中做到这一点。你知道吗
在Firefox中,我使用以下代码禁用推送通知:
profile = webdriver.FirefoxProfile()
profile.set_preference("dom.webnotifications.enabled", False)
在Chrome中,我使用这个:
from selenium.webdriver.chrome.options import Options
opt = Options()
opt.add_argument("--disable-notifications")
在Safari中,我尝试使用setu权限禁用推送通知,但没有成功。你知道吗
driver = webdriver.Safari()
driver.set_permission("--disable-notifications", True)
目前没有回答
相关问题 更多 >
编程相关推荐