You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Selenium/Python+ChromeDriver111.0.5563.64彻底禁用通知弹窗?

Facebook通知弹窗拦截无效问题

在Facebook主页,我会遇到以下烦人的通知弹窗:

fb弹窗

我尝试用以下代码绕过(但无效):

options = webdriver.ChromeOptions()
options.add_experimental_option(
    "prefs",
    {
        "credentials_enable_service": False,
        "profile.password_manager_enabled": False,
        "profile.default_content_setting_values.notifications": 2           
        # 设为2应该可以禁用通知
    },
)
# 再试一次
options.add_argument('--disable-notifications') 
options.add_argument("--password-store=basic")
options.add_argument("--disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument("start-maximized")

内容的提问来源于stack exchange,提问作者Mévatlavé Kraspek

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 15:44:59