I have added proxy settings to the browser using below code:
proxyIP = 'some IP'
proxyPort = some_port
proxy_settings = {'network.proxy.type': 1,
'network.proxy.http': proxyIP,
'network.proxy.http_port': proxyPort,
'network.proxy.ssl': proxyIP,
'network.proxy.ssl_port':proxyPort,
'network.proxy.socks': proxyIP,
'network.proxy.socks_port':proxyPort,
'network.proxy.ftp': proxyIP,
'network.proxy.ftp_port':proxyPort
}
with Browser('firefox',profile_preferences=proxy_settings) as browser:
Firefox browser opens up & when I check the proxy settings, they are loaded with correct values. But it fails to load the url with browser.visit('https://www.google.com/')
It throws the error:
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
I even added 'accept_untrusted_certs': True
in proxy_settings incase that would help. But to no avail.
If I manually enter a url in the browser-instance that gets created, it successfully visits the page.
- Is something missing?
- Is there a way to start the browser with its default profile (so that all proxy
settings, extensions, etc. get loaded automatically)? I tried
Browser(profile='profile_path')
, it did not work out.
In hope...
P.S: The same code (without proxy settings) works perfectly well on a system with direct internet.