The code which works fine locally is throwing an error when instance is created at AWS,I am very novice at it ,I have installed chrome driver and chrome in the instance..any help is highly appreciated below is the code until error
import logging
from kiteconnect import KiteConnect
from datetime import datetime,timedelta
import pandas as pd
from time import sleep
from selenium import webdriver
import undetected_chromedriver as uc
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import pyotp
driver=uc.Chrome()
error is "selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:41187 from chrome not reachable"
CodePudding user response:
I wonder if you can you try updating your Chrome driver again and copy it's direct path into your code. Also, check to see if you typed the path in correctly. Something similar to this happened to me before when I didn't have the updated Chrome driver in my code.
CodePudding user response:
This error message...
selenium.common.exceptions.WebDriverException: Message: unknown error: 'ms' must be a double (Session info: headless chrome=98.0.4758.102) (Driver info: chromedriver=2.37.544315
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
- You are using chrome=98.0
- Release Notes of ChromeDriver v98.0 clearly mentions the following :
Supports Chrome version 98
- But you are using chromedriver=2.37 which is old and ancient.
So there is a clear mismatch between chromedriver=91.0 and the chrome=96.0.4664.45
Solution
Ensure that:
- ChromeDriver is updated to current ChromeDriver v98.0 level.
- Chrome Browser is updated to current chrome=98 (as per chromedriver=98.0.4758.48 release notes).