Open woshichuanqilz opened 2 days ago
@woshichuanqilz, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
What happens when you execute on the terminal /home/lizhe/Applications/chromedriver-linux64/chromedriver
and /home/lizhe/Applications/chrome-linux64/chrome
?
Please share the terminal output.
What happens when you execute on the terminal
/home/lizhe/Applications/chromedriver-linux64/chromedriver
and/home/lizhe/Applications/chrome-linux64/chrome
?Please share the terminal output.
> /home/lizhe/Applications/chromedriver-linux64/chromedriver
Starting ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
---
> /home/lizhe/Applications/chrome-linux64/chrome
Created TensorFlow Lite XNNPACK delegate for CPU.
Attempting to use a delegate that only supports static-sized tensors w
ith a graph that has dynamic-sized tensors (tensor#141 is a dynamic-si
zed tensor).
That output looks strange for Chrome, is that the correct binary?
That output looks strange for Chrome, is that the correct binary?
I use
That output looks strange for Chrome, is that the correct binary?
The chrome I used above is from here: https://googlechromelabs.github.io/chrome-for-testing. Not my daily use chrome
Then I change the code to this (comment the options.binary_location = '/home/lizhe/Applications/chrome-linux64/chrome
) which may use the daily used chrome instead I think
import logging
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
def test_logging(log_path):
logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_path)
logger.addHandler(handler)
logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN)
logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG)
test_logging('ori.log')
CHROMEDRIVER_PATH = '/home/lizhe/Applications/chromedriver-linux64/chromedriver'
options = webdriver.ChromeOptions()
# options.binary_location = '/home/lizhe/Applications/chrome-linux64/chrome'
service = ChromeService(executable_path=CHROMEDRIVER_PATH)
driver = webdriver.Chrome(service=service, options=options)
url = "https://www.google.com"
driver.get(url)
input("please wait...")
Then I get error msg :
Traceback (most recent call last):
File "/home/lizhe/test2.py", line 23, in <module>
driver = webdriver.Chrome(service=service, options=options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
self.start_session(capabilities)
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
self.error_handler.check_response(response)
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
My daily used chrome version
google-chrome-stable --version ─╯
Google Chrome 126.0.6478.126
Msg output when run daily used chrome:
Opening in existing browser session.
Why don't you let Selenium Manager manage it?
Leave it like:
driver = webdriver.Chrome()
At first I just try the code like you write. But I get error msg like this, no useful msg shows out, cause the Message string is empty. I do some google work said that it may related to the chromedriver not found. So I change the code.
Still error.
Here is the code I tried at first.
import logging
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
def test_logging(log_path):
logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_path)
logger.addHandler(handler)
logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN)
logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG)
test_logging('ori.log')
driver = webdriver.Chrome()
url = "https://www.google.com"
driver.get(url)
input("please wait...")
Traceback (most recent call last):
File "/home/lizhe/tes3.py", line 20, in <module>
driver = webdriver.Chrome()
^^^^^^^^^^^^^^^^^^
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdri
ver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdri
ver/chromium/webdriver.py", line 66, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdri
ver/remote/webdriver.py", line 208, in __init__
self.start_session(capabilities)
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdri
ver/remote/webdriver.py", line 292, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdri
ver/remote/webdriver.py", line 347, in execute
self.error_handler.check_response(response)
File "/home/lizhe/.local/lib/python3.12/site-packages/selenium/webdri
ver/remote/errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
I don't see the log contents, just the stacktrace.
I don't see the log contents, just the stacktrace.
What is the stacktrace how to get it ?
When I run chrome from command line output : Opening in existing browser session.
What are the contents of ori.log
?
What are the contents of
ori.log
? code
import logging from selenium import webdriver from selenium.webdriver.chrome.service import Service as ChromeService
def test_logging(log_path): logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_path)
logger.addHandler(handler)
logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN)
logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG)
test_logging('ori.log') driver = webdriver.Chrome()
url = "https://www.google.com" driver.get(url) input("please wait...")
**ori.log**
Selenium Manager binary found at: /home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --debug --language-binding python --output json
Found chromedriver 126.0.6478.126 in PATH: /home/lizhe/Applications/chromedriver-linux64/chromedriver
Found chrome in PATH: /home/lizhe/Applications/chrome-linux64/chrome
Running command: /home/lizhe/Applications/chrome-linux64/chrome --version
Output: "Google Chrome for Testing 126.0.6478.126 "
Detected browser: chrome 126.0.6478.126
Required driver: chromedriver 126.0.6478.126
Driver path: /home/lizhe/Applications/chromedriver-linux64/chromedriver
Browser path: /home/lizhe/Applications/chrome-linux64/chrome
Started executable: /home/lizhe/Applications/chromedriver-linux64/chromedriver
in a child process with pid: 1951526 using 0 to output -3
# the log seems shows that the chrome not found
I change the code
```py
import logging
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
def test_logging(log_path):
logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_path)
logger.addHandler(handler)
logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN)
logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG)
test_logging('ori.log')
options = webdriver.ChromeOptions()
options.binary_location = '/usr/bin/google-chrome-stable'
driver = webdriver.Chrome(options)
url = "https://www.google.com"
driver.get(url)
input("please wait...")
ori.log
Selenium Manager binary found at: /home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/lizhe/.local/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --browser-path /usr/bin/google-chrome-stable --debug --language-binding python --output json
Found chromedriver 126.0.6478.126 in PATH: /home/lizhe/Applications/chromedriver-linux64/chromedriver
Running command: /usr/bin/google-chrome-stable --version
Output: "Google Chrome 126.0.6478.126 "
Detected browser: chrome 126.0.6478.126
Required driver: chromedriver 126.0.6478.126
Driver path: /home/lizhe/Applications/chromedriver-linux64/chromedriver
Browser path: /usr/bin/google-chrome-stable
Started executable: `/home/lizhe/Applications/chromedriver-linux64/chromedriver` in a child process with pid: 1957474 using 0 to output -3
Somehow the ChromeDriver you have in path is exiting with code -3.
Can you delete that binary and let Selenium Manager download it?
Somehow the ChromeDriver you have in path is exiting with code -3.
Can you delete that binary and let Selenium Manager download it?
Can you give me a link about how to use selenium to download the driver?
Somehow the ChromeDriver you have in path is exiting with code -3.
Can you delete that binary and let Selenium Manager download it?
I change the code to this.
import logging
from webdriver_manager.chrome import ChromeDriver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
def test_logging(log_path):
logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_path)
logger.addHandler(handler)
logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN)
logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG)
test_logging('ori.log')
options = webdriver.ChromeOptions()
options.binary_location = '/usr/bin/google-chrome-stable'
driver = webdriver.Chrome(options=options, service=ChromeService(ChromeDriverManager().install()))
url = "https://www.google.com"
driver.get(url)
input("please wait...")
output of command line said cant find chrome but I set it in the option, it is google-chrome-stable
╰─❯ python tes3.py
/bin/sh: line 1: google-chrome: command not found
/bin/sh: line 1: google-chrome: command not found
Traceback (most recent call last):
File "/home/lizhe/tes3.py", line 24, in <module
driver = webdriver.Chrome(options=options, se
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
self.start_session(capabilities)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
self.error_handler.check_response(response)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
ori.log
Skipping Selenium Manager; path to chrome driver specified in Service class: /home/lizhe/.wdm/drivers/chromedriver/linux64/126.0.6478.126/chromedriver-linux64/chromedriver
Started executable: `/home/lizhe/.wdm/drivers/chromedriver/linux64/126.0.6478.126/chromedriver-linux64/chromedriver` in a child process with pid: 1970029 using 0 to output -3
I create a symbolic link to google-chrome-stable named google-chrome.
Rerun the code
output
Traceback (most recent call last):
File "/home/lizhe/tes3.py", line 30, in <module>
driver = webdriver.Chrome(options=options, service=ChromeService(ChromeDriverManager().install()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
self.start_session(capabilities)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
self.error_handler.check_response(response)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
ori.log
Skipping Selenium Manager; path to chrome driver specified in Service class: /home/lizhe/.wdm/drivers/chromedriver/linux64/126.0.6478.126/chromedriver-linux64/chromedriver
Started executable: `/home/lizhe/.wdm/drivers/chromedriver/linux64/126.0.6478.126/chromedriver-linux64/chromedriver` in a child process with pid: 1974167 using 0 to output -3
You are going in circles, this is the same code you used to create the issue.
What I requested is for you to delete the ChromeDriver that you have on path and let Selenium Manager handle it.
You are going in circles, this is the same code you used to create the issue.
What I requested is for you to delete the ChromeDriver that you have on path and let Selenium Manager handle it.
I already delete the chromedriver. As you can see in the ori.log. The chromedriver is in the .wdm folder.
which chromedriver
wont locate any chromedriver
And the .wdm I also delete and re-download again.
@woshichuanqilz - I think you are mixing selenium and the webdrivermanager packages.
Can you please try the below sample and post back what you see ?
import logging
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
def test_logging(log_path):
logger = logging.getLogger('selenium')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(log_path)
logger.addHandler(handler)
logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN)
logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG)
test_logging('ori.log')
options = webdriver.ChromeOptions()
options.binary_location = '/usr/bin/google-chrome-stable'
driver = webdriver.Chrome(options=options, service=ChromeService())
url = "https://www.google.com"
driver.get(url)
print("Page title: ", driver.title)
driver.quit()
@woshichuanqilz - I think you are mixing selenium and the webdrivermanager packages.
Can you please try the below sample and post back what you see ?
import logging from selenium import webdriver from selenium.webdriver.chrome.service import Service as ChromeService def test_logging(log_path): logger = logging.getLogger('selenium') logger.setLevel(logging.DEBUG) handler = logging.FileHandler(log_path) logger.addHandler(handler) logging.getLogger('selenium.webdriver.remote').setLevel(logging.WARN) logging.getLogger('selenium.webdriver.common').setLevel(logging.DEBUG) test_logging('ori.log') options = webdriver.ChromeOptions() options.binary_location = '/usr/bin/google-chrome-stable' driver = webdriver.Chrome(options=options, service=ChromeService()) url = "https://www.google.com" driver.get(url) print("Page title: ", driver.title) driver.quit()
output
Traceback (most recent call last):
File "/home/lizhe/tes3.py", line 23, in <module>
driver = webdriver.Chrome(options=options, service=ChromeService())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
self.start_session(capabilities)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
self.error_handler.check_response(response)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
ori.log
Selenium Manager binary found at: /home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --browser-path /usr/bin/google-chrome-stable --debug --language-binding python --output json
chromedriver not found in PATH
Running command: /usr/bin/google-chrome-stable --version
Output: "Google Chrome 126.0.6478.126 "
Detected browser: chrome 126.0.6478.126
Required driver: chromedriver 126.0.6478.126
chromedriver 126.0.6478.126 already in the cache
Driver path: /home/lizhe/.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver
Browser path: /usr/bin/google-chrome-stable
Started executable: `/home/lizhe/.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver` in a child process with pid: 1989137 using 0 to output -3
@woshichuanqilz - For the last experiment, can you please comment out
options.binary_location = '/usr/bin/google-chrome-stable'
and re-run the sample? Basically we are trying to figure out as to what happens when selenium internally uses selenium manager to download the browser as well and then work with it.
In my case, when I had ran that sample on my mac, I got the below message in the logs (which re-iterates what I already knew i.e., the browser was not present in that path)
Running command: /usr/bin/google-chrome-stable --version
Output: ""
chrome not found in the system
Discovering versions from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
Required browser: chrome 126.0.6478.126
Downloading chrome 126.0.6478.126 from https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.126/mac-x64/chrome-mac-x64.zip
chrome 126.0.6478.126 is available at /Users/kmahadevan/.cache/selenium/chrome/mac-x64/126.0.6478.126/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing
@woshichuanqilz - For the last experiment, can you please comment out
options.binary_location = '/usr/bin/google-chrome-stable'
and re-run the sample? Basically we are trying to figure out as to what happens when selenium internally uses selenium manager to download the browser as well and then work with it.
In my case, when I had ran that sample on my mac, I got the below message in the logs (which re-iterates what I already knew i.e., the browser was not present in that path)
Running command: /usr/bin/google-chrome-stable --version Output: "" chrome not found in the system Discovering versions from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json Required browser: chrome 126.0.6478.126 Downloading chrome 126.0.6478.126 from https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.126/mac-x64/chrome-mac-x64.zip chrome 126.0.6478.126 is available at /Users/kmahadevan/.cache/selenium/chrome/mac-x64/126.0.6478.126/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing
output
Traceback (most recent call last):
File "/home/lizhe/tes3.py", line 22, in <module>
driver = webdriver.Chrome(options=options, service=ChromeService())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
self.start_session(capabilities)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
self.error_handler.check_response(response)
File "/home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
ori.log
Selenium Manager binary found at: /home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/lizhe/pyvenvL/.venv/lib/python3.12/site-packages/selenium/webdriver/common/linux/selenium-manager --browser chrome --debug --language-binding python --output json
chromedriver not found in PATH
chrome not found in PATH
chrome not found in the system
Required browser: chrome 126.0.6478.126
chrome 126.0.6478.126 already exists
chrome 126.0.6478.126 is available at /home/lizhe/.cache/selenium/chrome/linux64/126.0.6478.126/chrome
Required driver: chromedriver 126.0.6478.126
chromedriver 126.0.6478.126 already in the cache
Driver path: /home/lizhe/.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver
Browser path: /home/lizhe/.cache/selenium/chrome/linux64/126.0.6478.126/chrome
Started executable: `/home/lizhe/.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver` in a child process with pid: 1997294 using 0 to output -3
Ok. My guess is that there is some issue when it comes to executing the chromedriver
binary in your machine.
Have you tried manually running to see if it works fine ?
Here's what I see.
➜ 126.0.6478.126 pwd
/Users/kmahadevan/.cache/selenium/chromedriver/mac-x64/126.0.6478.126
➜ 126.0.6478.126 ls -ltr
total 36944
-rwxr-xr-x@ 1 kmahadevan staff 18911688 Jun 28 21:45 chromedriver
➜ 126.0.6478.126 ./chromedriver -v
ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591})
➜ 126.0.6478.126
Ok. My guess is that there is some issue when it comes to executing the
chromedriver
binary in your machine.还行。我的猜测是在您的机器中执行chromedriver
二进制文件时存在一些问题。Have you tried manually running to see if it works fine ?您是否尝试过手动运行以查看它是否正常工作?
Here's what I see.这是我所看到的。
➜ 126.0.6478.126 pwd /Users/kmahadevan/.cache/selenium/chromedriver/mac-x64/126.0.6478.126 ➜ 126.0.6478.126 ls -ltr total 36944 -rwxr-xr-x@ 1 kmahadevan staff 18911688 Jun 28 21:45 chromedriver ➜ 126.0.6478.126 ./chromedriver -v ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591}) ➜ 126.0.6478.126
╰─❯ pwd ─╯
/home/lizhe/.wdm/drivers/chromedriver/linux64/126.0.6478.126/chromedriver-linux64
╰─❯ ./chromedriver -v ─╯
ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591})
> ./chromedriver ─╯
Starting ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
You just need this?
@woshichuanqilz - yeah that output rules out any issues with chromedriver.
I noticed in this comment https://github.com/SeleniumHQ/selenium/issues/14219#issuecomment-2202428867 that you mentioned you are using CFT version of google chrome. I don't know if that can be related to the problem or not.
So to rule out the role of the CFT version of Google chrome, can we try this as well?
chromedriver
as you did in your earlier comment.#!/bin/sh
curl --location 'localhost:9515/session' \
--header 'Content-Type: application/json; charset=utf-8' \
--data '{
"capabilities": {
"firstMatch": [
{
"browserName": "chrome"
}
]
}
}'
JSON response on the terminal
{"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"126.0.6478.127","chrome":{"chromedriverVersion":"126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591})","userDataDir":"/var/folders/1f/rc_t2_qj41x3_9n8bhn5grr00000gn/T/.org.chromium.Chromium.8Zi5VJ"},"fedcm:accounts":true,"goog:chromeOptions":{"debuggerAddress":"localhost:63445"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"mac","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:extension:minPinLength":true,"webauthn:extension:prf":true,"webauthn:virtualAuthenticators":true},"sessionId":"87213362fb6d1bac0c7a26c33502a3e1"}
Also.. I think the .wdm
directory is from Webdriver manager. Selenium stores all its driver and browser binaries under .cache
directory which is different. Please check that once.
- 是的,输出排除了 ChromeRiver 的任何问题。
I noticed in this comment https://github.com/SeleniumHQ/selenium/issues/14219#issuecomment-2202428867 that you mentioned you are using CFT version of google chrome. I don't know if that can be related to the problem or not.
I already delete CFT chrome since this post above. Just use the normal chrome. Same issue.
Start the chromedriver as you did in your earlier comment. Run a curl command as below and check if you are seeing chrome browser open up and also see a JSON response as below ?
You mean start the chromedriver first, then run the curl command? Nothing shows in the terminal. The chrome name on my pc is google-chrome-stable. I change browserName to google-chrome-stable not msg shown either.
I use browser to access "http://localhost:9515/" And get this:
{"value":{"error":"unknown command","message":"unknown command: unknown command: ","stacktrace":"#0 0x555f937f8c7a \u003Cunknown>\n#1 0x555f934dbe2c \u003Cunknown>\n#2 0x555f935453f9 \u003Cunknown>\n#3 0x555f93544f8a \u003Cunknown>\n#4 0x555f934a6a88 \u003Cunknown>\n#5 0x555f937bf24b \u003Cunknown>\n#6 0x555f937c32f1 \u003Cunknown>\n#7 0x555f937aaafe \u003Cunknown>\n#8 0x555f937c3e52 \u003Cunknown>\n#9 0x555f9378f79f \u003Cunknown>\n#10 0x555f934a5066 \u003Cunknown>\n#11 0x7fb72d251c88 \u003Cunknown>\n#12 0x7fb72d251d4c __libc_start_main\n#13 0x555f934700ea _start\n"}}
Also.. I think the .wdm directory is from Webdriver manager. Selenium stores all its driver and browser binaries under .cache directory which is different. Please check that once.
.wdm
╰─❯ pwd ─╯
/home/lizhe/.wdm
╭─ ~/.wdm ─╮
╰─❯ tree ─╯
.
├── drivers
│ └── chromedriver
│ └── linux64
│ └── 126.0.6478.126
│ ├── chromedriver-linux64
│ │ ├── chromedriver
│ │ └── LICENSE.chromedriver
│ └── chromedriver-linux64.zip
└── drivers.json
.cache Contains chrome and chromedriver
/home/lizhe/.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver
/home/lizhe/.cache/selenium/chrome/linux64/126.0.6478.126/chrome
You mean start the chromedriver first, then run the curl command? Nothing shows in the terminal.
Yes. That's what I meant. What happens on the terminal when you do that? Does it exit immediately or do you see the prompt stall? Do you see a browser open up?
The chrome name on my pc is google-chrome-stable. I change browserName to google-chrome-stable not msg shown either.
I dont think that the name of the browser binary matters. You should use chrome
.
Yes. That's what I meant. What happens on the terminal when you do that? Does it exit immediately or do you see the prompt stall? Do you see a browser open up?
Nothing happens. No output in ther terminal . And browser don't start
@woshichuanqilz - What if you start chromedriver
with debug logs enabled and then trigger the curl command ?
For me I see something like below
➜ 126.0.6478.126 ./chromedriver --log-level=DEBUG
Starting ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1720008443.822][INFO]: [0391bbb4813c119ff3973f4c446924ff] COMMAND InitSession {
"capabilities": {
"firstMatch": [ {
"browserName": "chrome"
} ]
}
}
[1720008443.822][INFO]: Browser search. Trying... /Users/kmahadevan/.cache/selenium/chromedriver/mac-x64/126.0.6478.126/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing
[1720008443.822][INFO]: Browser search. Trying... /Users/kmahadevan/.cache/selenium/chromedriver/mac-x64/126.0.6478.126/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing
[1720008443.822][INFO]: Browser search. Trying... /Users/kmahadevan/.cache/selenium/chromedriver/mac-x64/126.0.6478.126/Google Chrome.app/Contents/MacOS/Google Chrome
[1720008443.822][INFO]: Browser search. Trying... /Users/kmahadevan/.cache/selenium/chromedriver/mac-x64/126.0.6478.126/Chromium.app/Contents/MacOS/Chromium
Its a verbose log and so I have trimmed the rest of the output.
--log-level=DEBUG
╰─❯ .cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver --log-level=DEBUG ─╯
Starting ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Same with no debug flag
@woshichuanqilz - If you are not able to run chromedriver
and have it spin off a chrome
browser, I think it could be an issue with chromedriver
itself for your particular platform.
@diemol WDYT ?
I don't think you followed the steps we are asking...
Step one, in an empty terminal, where the ChromeDriver binary is placed do:
.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver --log-level=DEBUG
Step do, in a new terminal, execute:
#!/bin/sh
curl --location 'localhost:9515/session' \
--header 'Content-Type: application/json; charset=utf-8' \
--data '{
"capabilities": {
"firstMatch": [
{
"browserName": "chrome"
}
]
}
}'
Please share the output from both terminals and tell us if the browser opens or not.
I don't think you followed the steps we are asking...
Step one, in an empty terminal, where the ChromeDriver binary is placed do:
.cache/selenium/chromedriver/linux64/126.0.6478.126/chromedriver --log-level=DEBUG
Step do, in a new terminal, execute:
#!/bin/sh curl --location 'localhost:9515/session' \ --header 'Content-Type: application/json; charset=utf-8' \ --data '{ "capabilities": { "firstMatch": [ { "browserName": "chrome" } ] } }'
Please share the output from both terminals and tell us if the browser opens or not.
browser not open . no output
I am not sure what is wrong with your machine. Or is that terminal connected to another machine, and are you executing commands on a different VM?
What happens if you try it on a different machine?
If this was an actual problem, we would have many open issues.
What happened?
Basic code of selenium failed to start. I tried code
Code 1
I get error message:
Code 2
get error message
How can we reproduce the issue?
Relevant log output
Operating System
Manjaro Linux Wynsdey 24.0.2 x86_64
Selenium version
4.22.0
What are the browser(s) and version(s) where you see this issue?
Google Chrome 126.0.6478.126
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 126.0.6478.126 (d36ace6122e0a59570e258d82441395206d60e1c-refs/branch-heads/6478@{#1591})
Are you using Selenium Grid?
no
Other info
hosts file contains
127.0.0.1 localhost