I am trying to use Python undetected-chromedriver==3.0.6 for web automation and web scraper.
I want to search Google using python selenium. I want to enter Google using Python Selenium but my coding shows the below error.
This is the simple code I am trying to use
import undetected_chromedriver.v2 as uc
from time import sleep
from multiprocessing import freeze_support
if __name__ == '__main__':
freeze_support()
url = "https://www.google.com/"
chrome_driver = uc.Chrome()
chrome_driver.get(url)
sleep(5)
scraped_page = chrome_driver.page_source
chrome_driver.quit()
print(scraped_page)
However, I get the error :
Traceback (most recent call last):
File "C:\Users\Anik Saha\Desktop\VFSBot\test.py", line 10, in <module>
chrome_driver = uc.Chrome()
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\undetected_chromedriver\v2.py", line 309, in __init__
super(Chrome, self).__init__(
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 84, in __init__
super().__init__(
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 104, in __init__
super().__init__(
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 286, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\undetected_chromedriver\v2.py", line 600, in start_session
super(Chrome, self).start_session(capabilities, browser_profile)
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 378, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
self.error_handler.check_response(response)
File "C:\Users\Anik Saha\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, 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:50655
from session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 116.0.5845.141
Stacktrace:
Backtrace:
GetHandleVerifier [0x010CA813+48355]
(No symbol) [0x0105C4B1]
(No symbol) [0x00F65358]
(No symbol) [0x00F861AC]
(No symbol) [0x00F806B4]
(No symbol) [0x00F80491]
(No symbol) [0x00FB0C55]
(No symbol) [0x00FB093C]
(No symbol) [0x00FAA536]
(No symbol) [0x00F882DC]
(No symbol) [0x00F893DD]
GetHandleVerifier [0x0132AABD+2539405]
GetHandleVerifier [0x0136A78F+2800735]
GetHandleVerifier [0x0136456C+2775612]
GetHandleVerifier [0x011551E0+616112]
(No symbol) [0x01065F8C]
(No symbol) [0x01062328]
(No symbol) [0x0106240B]
(No symbol) [0x01054FF7]
BaseThreadInitThunk [0x754500C9+25]
RtlGetAppContainerNamedObjectPath [0x775E7B1E+286]
RtlGetAppContainerNamedObjectPath [0x775E7AEE+238]
My current Chrome version:
Current Python Version: Python 3.10.5