Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(session not created: DevToolsActivePort file doesn't exist) #7

Open
damianludwiczak89 opened this issue Jan 20, 2025 · 1 comment
Open

Comments

@damianludwiczak89
Copy link

Hi,

I created a repo using your template and tried to run without any changes to see how it works but I got an error saying:

Traceback (most recent call last):
  File "/home/runner/work/scraper/scraper/Selenium-Template.py", line 34, in <module>
    driver = webdriver.Chrome(options = chrome_options)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 241, in __init__
    self.start_session(capabilities)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 329, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 384, in execute
    self.error_handler.check_response(response)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
  (session not created: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x5603806ca1fa <unknown>
#1 0x5603801da810 <unknown>
#2 0x560380211ed8 <unknown>
#3 0x56038020da36 <unknown>
#4 0x560380259816 <unknown>
#5 0x560380258e66 <unknown>
#6 0x56038024d323 <unknown>
#7 0x56038021bde0 <unknown>
#8 0x56038021cdbe <unknown>
#9 0x56038069612b <unknown>
#10 0x56038069a0c7 <unknown>
#11 0x5603806836cc <unknown>
#12 0x56038069ac47 <unknown>
#13 0x56038066867f <unknown>
#14 0x5603806b9288 <unknown>
#15 0x5603806b9450 <unknown>
#16 0x5603806c9076 <unknown>
#17 0x7fcfb569ca94 <unknown>
#18 0x7fcfb5729c3c <unknown>

Any idea how to solve this? Did I do something wrong? Or is there a problem with Chrome/Driver version?

Thank you

@damianludwiczak89
Copy link
Author

Probably opened this issue too fast, uncommenting some options helped:

options = [
  # Define window size here
   "--window-size=1200,1200",
    "--ignore-certificate-errors"
 
    "--headless",
    #"--disable-gpu",
    #"--window-size=1920,1200",
    #"--ignore-certificate-errors",
    #"--disable-extensions",
    "--no-sandbox",
    "--disable-dev-shm-usage",
    '--remote-debugging-port=9222'
]

It seems to be working now fine! Can close or delete issue

Thank you for this tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant