This post is posted on my personal blog: Selenium Error Reporting – Unknown Error DevToolsActivePort File doesn’t exist — Zhang0Peter’s personal blog
There was a problem launching Chrome with selenium on Linux in the morning:
error:
Traceback (most recent call last):
File "get2.py", line 62, in <module>
browser = webdriver.Chrome()
File "/root/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 75, in __init__
desired_capabilities=desired_capabilities)
File "/root/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/root/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/root/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute
self.error_handler.check_response(response)
File "/root/.pyenv/versions/anaconda3-5.1.0/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.9.0-6-amd64 x86_64)
Solution:
plus code:
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument('--headless')
browser = webdriver.Chrome(chrome_options=chrome_options)
“– no-sandbox” parameter is to let Chrome run
“– headless” parameter is not to open the graphical interface
can add these parameters to get a better experience
chrome_options.add_argument('blink-settings=imagesEnabled=false')
chrome_options.add_argument('--disable-gpu')
div>
Read More:
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn
- Unknown error: cannot find chrome binary when running selenium under Linux
- Systemctl command doesn’t exist. How to solve the problem that the service can’t be started
- mysql Table ‘performance_ schema.session_ Variables’ doesn’t exist solution
- Django. DB. Utils. Programmingerror: (1146, “table * doesn’t exist”) causes and Solutions
- Using selenium server- standalone.jar Console error: unknown error: cannot get automation extension solution
- 1072 – Key column ‘xxx_id’ doesn’t exist in table
- Table ‘sell.hibernate_sequence‘ doesn‘t exist
- MySQL – ERROR 1146 (42S02): Table ‘mysql.user’ doesn’t exist
- One of the configured repositories failed (Unknown), and yum doesn’t have enough cached data to cont
- Fedora32 start container error – OCI runtime create failed: This version of runc doesn’t work on cgroups V2: unknown
- Error 1146 (42s02): table ‘database name. Table name’ doesn’t exist ‘
- solve selenium.common.exceptions .ElementNotInteractableException: Message: element not interactable
- Solve the problem that the interface between C # WinForm program and Oracle doesn’t respond for a long time
- Solve the problem that idea’s. Gitignore doesn’t work sometimes
- Selenium driver chrome failed to start and reported an error
- Pandas read the CSV file error filenotf oundError:File b ‘***.csv’ does not exist
- [Solved] Golden Gate ggsci start manager: ERROR: Parameter file mgr.prm does not exist.
- Solve the problem of the C compiler identification is unknown or the cxx compiler identification is unknown in the process of using cmake
- Solution of selenium driven edge error reporting