简体   繁体   中英

Chrome can't open a profile using selenium python

When I run this code

import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
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/")
This error pops up : [12216:1336:0411/232857.718:ERROR:browser_switcher_service.cc(238)] XXX Init()

Could someone please help me. I don't know what is wrong but the programm won't open the new profile I created. Any help would be appreciated.

I searched everywhere how to fix this error but I think the guides are outdated

Check your Chrome browser version and your Chrome webdriver version. If both are same then issue should be solved.

One thing to check would be, if your ChromeDriver-Executable matches the version of the Chrome you have installed (under Help/About Google Chrome in your browser). There are versions 79, 80 and 81 mostly in use. You can find the current ChromeDrivers for all three versions here: https://chromedriver.chromium.org/downloads .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM