I'm currently trying to run a Chrome WebDriver with Selenium in a python script but I'm currently generating the error:
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
The way I've set up the script is a bit weird. The server I want to run it on is using Windows, but it doesn'e have any python versions downloaded, so what I'm doing is editing and debugging the script on my personal computer, which also uses Windows, and then turning the script into a windows executable using pyinstaller. The executable is then put on the remote server and I run it there.
The portion of code for generating the ChromeDriver that I'm using is as follows:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("download.default_directory={}".format(os.getcwd()))
options.add_argument("--headless")
options.add_argument("--disable-gpu")
options.add_argument("--no-sandbox")
options.add_argument("--disable-setuid-sandbox")
options.add_argument("--remote-debugging-port=9222")
options.binary_location = ".\\chrome-win32\\chrome.exe"
service = Service(executable_path=".\\chrome-win32\\driver\\chromedriver.exe")
driver = webdriver.Chrome(service=service, options=options)
I have a folder named "chrome-win32" in the directory where the executable is stored that holds the chrom executable and I also have a folder named "driver" in there that holds the chromedriver executable. All this is to say that I don't think that there's any problems with my file structure.
I have double and triple checked my chrome and chrome driver versions. Both are the most recent downloads of the stable versions released on Chrome for Testing and both are the windows 32 bit releases.
All three of the mentioned executables have permission to execute.
I have tried looking at similar questions here on stack overflow, but most of the answers I've seen boil down to not having compabtible version of chrome and chromedriver, which I know is not the case here.
I've tried adding some arguments to Options however none of them have really helped, but I kept the options that I've tried in the code in case I'm doing something wrong or unnecessary.