Reputation: 67
I am doing a python selenium project , I am able to open the chrome browser but it is not typing url into it. Have below is my code and system details.
Python 2.7 Selenium 3.13 Chrome Driver 2.4 Chrome Version 67 Windows 10 -64 bit
Error : -Traceback (most recent call last)
Code :-
from selenium import webdriver
options=webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\User\aditi\AppData\Local\Google\Chrome\User Data")
driver= webdriver.Chrome(executable_path="C:\chrome driver\chromedriver.exe",chrome_options=options)
driver.get("https://stackoverflow.com/")
Error Message
C:\Python27\python.exe
"C:/Users/aditi/PycharmProjects/DMS/PolicyDownload.py"
Traceback (most recent call last):
File "C:/Users/aditi/PycharmProjects/DMS/PolicyDownload.py", line 5, in <module>
driver= webdriver.Chrome(executable_path="C:\chrome driver\chromedriver.exe",chrome_options=options)
File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__
desired_capabilities=desired_capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 251, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "C:\Python27\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: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab),platform=Windows NT 10.0.16299 x86_64)
Upvotes: 0
Views: 1130
Reputation: 1329
I had same issue resolved by replacing "\" which is 1 time , by 2 times backword slash"\"
Check if same work for you as well.
Upvotes: 1