要去掉微软浏览器的登录提示窗口,可以尝试以下方法:

  1. 使用 --disable-extensions 参数启动浏览器,禁用所有扩展程序,包括登录提示窗口。
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--disable-extensions")

# 使用微软浏览器驱动启动浏览器
driver = webdriver.Edge(options=options)
  1. 通过修改浏览器的配置文件,禁用登录提示窗口。
from selenium import webdriver

# 打开 Edge 浏览器的配置文件
options = webdriver.EdgeOptions()
options.add_argument("user-data-dir=/path/to/edge/profile")  # 替换为实际的配置文件路径

# 使用微软浏览器驱动启动浏览器
driver = webdriver.Edge(options=options)

请注意,以上方法可能会因为浏览器版本、驱动版本等因素而有所差异,建议根据具体情况进行尝试和调整

python selenium4 微软浏览器 提示登陆的窗口 怎么去掉

原文地址: http://www.cveoy.top/t/topic/iovi 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录