当我运行此代码时
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument("--disable-infobars")
chrome_options.add_argument("--start-maximized")
chrome_options.add_argument(r"user-data-dir=C:\Users\micha\AppData\Local\Google\Chrome\User Data\Profile 1")
driver = webdriver.Chrome(executable_path=r'C:\Users\micha\Desktop\Visual_projects\chromedriver.exe', chrome_options = chrome_options)
driver.get("https://store.steampowered.com/")
弹出此错误: [12216:1336:0411/232857.718:错误:browser\u switcher\u service.cc(238)]XXX Init()
谁能帮帮我吗。我不知道出了什么问题,但程序不会打开我创建的新配置文件。任何帮助都将不胜感激
我到处寻找如何修复这个错误,但我认为指南已经过时了
不是你问题的确切答案。但是我发现这个非常有用
另外,我看到您正在尝试包括用户目录选项。实际上,这不是必需的,因为它在启动
chromedriver.exe
时创建了一个临时目录了解
chromedriver.exe
-chromedriver.exe -h
的选项非常有帮助请参阅下面的示例,在我的末尾,该示例非常有效。另外,我更喜欢在窗口中使用没有空格的路径,这有助于保持简单。 如果您使用
verbose
而不是log-level=INFO
,您将获得所有日志在chromedriver日志中,您可以看到给定给
chromedriver.exe
的默认参数service.stop()
终止chromedriver.exe
,否则它将在后台继续运行。我端的文件夹结构如下所示:
另外,创建为
killchromedriver.py
文件以终止所有chromedriver.exe
实例,以防它们在后台运行更新: 添加选项以删除信息栏和保存密码弹出窗口
将我的chrome浏览器更新为81版,因此也必须更新chrome webdriver。但是在更新之后,它也开始给我这个错误。 这是代码,我已经从中删除了其他方法/函数
[3220:14704:0416/145232.014:错误:browser\u switcher\u service.cc(238)]XXX Init()
相关问题 更多 >
编程相关推荐