Issue
The Following Error is given when i run my code:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
I have tried to download a newer version of chromdriver but it still gives me the same error. I have tried to replace the current chromedriver that's running and the one I downloaded recently but it still gave the same error, so I downloaded the compatible version of chromdriver, and then I used this line of code:
driver = webdriver.Chrome(executable_path='D:\talha\Documents\Projects For Portfolio\SmmoBot\chromedriver_win32\chromedriver.exe')
But this returns the following error:
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH
Solution
You can download and use the latest ChromeDriver automatically using webdrivermanager-python.
This can be achieved by installing the webdriver-manager using the command:
pip install webdriver-manager
Implemention through code:
from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) driver.get("https://www.google.com/")
Answered By - undetected Selenium
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.