I tried everything but I am just getting this error this is not happening in my local pc.
import undetected_chromedriver as uc from undetected_chromedriver import ChromeOptions from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException options = ChromeOptions() options.add_argument("--disable-extensions") options.add_argument('--disable-application-cache') options.add_argument('--disable-gpu') options.add_argument("--no-sandbox") options.add_argument("--disable-setuid-sandbox") options.add_argument("--disable-dev-shm-usage") options.add_argument("--incognito") driver = uc.Chrome(options=options) driver.get('https://google.com/')
Traceback (most recent call last):
File "/home/mefor/main.py", line 19, in <module>
main()
File "/home/mefor/main.py", line 16, in main
login()
File "/home/mefor/login.py", line 23, in login
driver = uc.Chrome(options=options)
File "/home/mefor/.local/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 466, in __init__
super(Chrome, self).__init__(
File "/home/mefor/.local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
super().__init__(
File "/home/mefor/.local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 61, in __init__
super().__init__(command_executor=executor, options=options)
File "/home/mefor/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
self.start_session(capabilities)
File "/home/mefor/.local/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 724, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/home/mefor/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
File "/home/mefor/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
self.error_handler.check_response(response)
File "/home/mefor/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:59965
from chrome not reachable
Stacktrace:
#0 0x564bfe487d93 <unknown>
#1 0x564bfe16b177 <unknown>
#2 0x564bfe15602a <unknown>
#3 0x564bfe1a4cf8 <unknown>
#4 0x564bfe19b1cb <unknown>
#5 0x564bfe1e5b7c <unknown>
#6 0x564bfe1d91e3 <unknown>
#7 0x564bfe1a9135 <unknown>
#8 0x564bfe1aa13e <unknown>
#9 0x564bfe44be4b <unknown>
#10 0x564bfe44fdfa <unknown>
#11 0x564bfe4386d5 <unknown>
#12 0x564bfe450a6f <unknown>
#13 0x564bfe41c69f <unknown>
#14 0x564bfe475098 <unknown>
#15 0x564bfe475262 <unknown>
#16 0x564bfe486f34 <unknown>
#17 0x7fe1e5f2b609 start_thread