Yassine Krout
Yassine Krout

Reputation: 61

selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_CONNECTION_REFUSED

I am using Selenium. My application shows an error page. It throws the following error:

    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: chrome=104.0.5112.102)
Stacktrace:

This is my code

    from selenium import webdriver 

driver = webdriver.Chrome('C:path/in/the/pc/chromedriver_win32/chromedriver.exe')    ## to initialize the webdriver to the Selenium 
driver.get('http://127.0.0.1:5000/base')

How can I resolve the above error?

Upvotes: 6

Views: 15990

Answers (1)

Charles
Charles

Reputation: 51

driver.get('http://127.0.0.1:5000/base')

make sure 'http://127.0.0.1:5000/base' you can reach this with chrome, nothing wrong with your code just try another link.

driver.get('https://www.google.com/')

hope it can solve your problem

Upvotes: 5

Related Questions