-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
Description
Description
I follow the doc https://selenium-python.readthedocs.io/getting-started.html#simple-usage and expects to work, but it failed with selenium.common.exceptions.WebDriverException: Message:
without saying more about that Message.
System info:
- OS: Arch Linux 6.13.6-arch1-1
- Python: 3.13.2
- Firefox: 138.0.4
Backtrace:
Traceback (most recent call last):
File "/home/hervey_arch/py_crawler_qq/tmp_debug.py", line 10, in <module>
from selenium import webdriver;driver = webdriver.Firefox()
~~~~~~~~~~~~~~~~~^^
File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
super().__init__(command_executor=executor, options=options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 260, in __init__
self.start_session(capabilities)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 357, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 448, in execute
self.error_handler.check_response(response)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/errorhandler.py", line 196, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
I use pdb to find the problem, the above response
is {'status': [13, 'unknown error'], 'value': ''}
, caps
is same as what the log shows, capabilities
is {'browserName': 'firefox', 'acceptInsecureCerts': True, 'moz:debuggerAddress': True, 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'moz:firefoxOptions': {'binary': '/usr/bin/firefox', 'prefs': {'remote.active-protocols': 1}}}
and the rest are the default:
(Pdb) p executor
<selenium.webdriver.firefox.remote_connection.FirefoxRemoteConnection object at 0x74b282e057f0>
(Pdb) p options
<selenium.webdriver.firefox.options.Options object at 0x74b282e05160>
Reproducible Code
from selenium import webdriver;driver = webdriver.Firefox()
Debugging Logs
Selenium Manager binary found at: /home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/common/linux/selenium-manager --browser firefox --debug --language-binding python --output json
Found geckodriver 0.36.0 in PATH: /usr/bin/geckodriver
firefox detected at /usr/bin/firefox
Running command: /usr/bin/firefox -v
Output: "Mozilla Firefox 138.0.4"
Detected browser: firefox 138.0.4
Required driver: geckodriver 0.36.0
Driver path: /usr/bin/geckodriver
Browser path: /usr/bin/firefox
Started executable: `/usr/bin/geckodriver` in a child process with pid: 53733 using 0 to output -3
POST http://localhost:38413/session {'capabilities': {'firstMatch': [{}], 'alwaysMatch': {'browserName': 'firefox', 'acceptInsecureCerts': True, 'moz:debuggerAddress': True, 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'moz:firefoxOptions': {'binary': '/usr/bin/firefox', 'prefs': {'remote.active-protocols': 1}}}}}
Remote response: status=503 | data= | headers=HTTPHeaderDict({'Connection': 'close', 'Proxy-Connection': 'close', 'Content-Length': '0'})
Finished Request