Siddhartha Mondal
Siddhartha Mondal

Reputation: 81

Whenever I try to run Chrome using selenium using Python I get this error. has anyone experienced this before?

Code:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome(executable_path = r"C:\Users\Dell\Desktop\chromedriver.exe")
driver.get("http:/https://stackoverflow.com/")

Traceback (most recent call last): File "C:\Users\Dell\Desktop\Intro.py", line 3, in driver = webdriver.Chrome(executable_path = r"C:\Users\Dell\Desktop\chromedriver.exe") File "C:\Users\Dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init RemoteWebDriver.init( File "C:\Users\Dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "C:\Users\Dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\Dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Dell\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: failed to write prefs file

Upvotes: 2

Views: 1321

Answers (2)

Newbie
Newbie

Reputation: 25

Here is my version of the working code.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome(executable_path="C:\Windows\chromedriver.exe")
driver.get("https://stackoverflow.com/")

Try adding chromedriver to C:\Windows. Check both chrome and chromedriver having the same version.

Upvotes: 0

wasif
wasif

Reputation: 15470

This can cause if your C drive has not enough space. So use any tools like Disk Cleaner or CCleaner to free up some space.

Upvotes: 0

Related Questions