I've seen the DevToolsActivePort error come up in a couple of StackOverflow posts, but not of the fixes for those have worked for me. I'm using a Chromium browser (as opposed to Google Chrome), so that might be where I'm running into issues?
This is my code:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import ChromeType
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--headless')
... # plus other options, but the above 3 seem to have solved the issue for other users
options.binary_location = '/usr/bin/chromium-browser'
driver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install(),chrome_options=options)
I'm using ChromeDriverManager to avoid problems with chromedriver version compatibility.
This gives the error selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
.
Any pointers on what might be causing the issue are appreciated.
question from:
https://stackoverflow.com/questions/65871342/selenium-webdriverexception-devtoolsactiveport-file-doesnt-exist-chromium-bro 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…