I am trying to open up a log in page of a certain website using this code below:
print('Setting up proxy...')
selenium_proxy = webdriver.Proxy()
selenium_proxy.proxy_type = webdriver.common.proxy.ProxyType.PAC
selenium_proxy.proxyAutoconfigUrl = "./proxy.pac/"
print('Setting up headless display...')
global display
display = Display(visible=0, size=(1920, 1080),)
display.start()
print('Setting up profile...')
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
profile.set_proxy(selenium_proxy)
caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
binary = FirefoxBinary('/usr/bin/firefox')
global driver
driver = webdriver.Firefox(firefox_profile=profile, capabilities=caps, firefox_binary=binary, executable_path='/usr/bin/geckodriver', log_path='../Logs/geckodriver.log')
print('Opening browser...')
driver.get(url)
But I always encounter this Exception:
WebDriverException: Message: Reached error page: about:neterror?e=connectionFailure&u=https%3A<url>/account/login%3FloginType%3D&c=UTF-8&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20server%20at%20<url>
Please note that my code works for some websites.