Why i have this error even though i have the chromedriver.exe in the same directory as my python file session_cookie.py
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver.exe'
def login(self):
chrome_driver_path = 'chromedriver.exe'
options = webdriver.ChromeOptions()
# Run in headless mode without opening a browser window
options.add_argument('--headless') # Run in headless mode
# Disable GPU for headless mode
options.add_argument('--disable-gpu')
service = webdriver.ChromeService(executable_path=chrome_driver_path)
browser = webdriver.Chrome(service=service)
This may be because the file isn’t on the root!
Try putting ./ behind chromedriver.exe, like so: ./chromedriver.exe
Otherwise, you may need path to route to the path!
oh, i didn’t realize replit uses linux, so i downloaded the linux version of chromedriver
but i’m getting this error now selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions.