Python Forum
selenium - chrome crashes when chrome is running.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
selenium - chrome crashes when chrome is running.
#1
I've got this code:

    options = webdriver.ChromeOptions()
options.add_argument("--user-data-dir=C:/Users/RvBVakama/AppData/Local/Google/Chrome/User Data")
options.add_argument("--disable-extensions")
options.binary_location = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
    
w = webdriver.Chrome(executable_path="C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe", options=options)
    
w.get("https://www.google.com/")
When I run my program without any chrome processes active, it works.

Another post said it was an issue with a non-default installation of the chrome binary, but my install was installed in the default location.

When I run it with any chrome processes active it fails and gives this log:

Error:
Traceback (most recent call last): File "tet.py", line 9, in <module> w = webdriver.Chrome(executable_path="C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe", options=options) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__ desired_capabilities=desired_capabilities) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\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: Chrome failed to start: crashed (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 6.1.7601 SP1 x86_64)
My aim is to have my program run in the background once every hour. If my program requires me to close every tab and window just to run my script I would not be nice.

Thanks :)
Reply
#2
from error traceback:
Quote:so ChromeDriver is assuming that Chrome has crashed
So not chromedriver, but chrome itself.
Reply
#3
I wish I could change the title
Reply
#4
Quote:I wish I could change the title
changed for you
Reply
#5
download chrome driver from here, dont use your chrome browser
https://sites.google.com/a/chromium.org/.../downloads

set the path to that driver, and then get rid of your options code
w = webdriver.Chrome("C:/USER/Downloads/chromedriver")
w.get("https://www.google.com/")
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I get rid of "Chrome is being controlled by automated test software"? jetBlack 2 12,536 Jul-21-2022, 08:31 AM
Last Post: Benjamin112
  little parser-script crashes after doing good work for some time apollo 0 1,627 Feb-03-2021, 10:48 AM
Last Post: apollo
  How do I iterate over an array and perform actions using selenium chrome webdriver? master 0 2,386 Sep-14-2020, 05:28 AM
Last Post: master
  Expose chrome extension buttons to Python robertjaxe 2 2,312 May-12-2020, 07:52 PM
Last Post: robertjaxe
  Selenium/chrome console WiPi 4 5,826 Apr-12-2020, 11:45 AM
Last Post: WiPi
  Chrome instead of IE Friend 1 2,121 Feb-09-2020, 07:31 AM
Last Post: Larz60+
  Headless Chrome: How to login into a webpage? amandacstr 1 4,228 Feb-06-2020, 02:19 AM
Last Post: metulburr
  error when running headless selenium julio2000 2 4,503 Feb-01-2020, 12:41 PM
Last Post: julio2000
  Interfacing Google Chrome & Python akornrumpf 5 3,988 Mar-16-2019, 10:20 PM
Last Post: Larz60+
  Selenium Web Driver Exe not running in other PC's Utkarsh29 2 4,409 Feb-28-2019, 05:48 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020