Here is the code I'm trying to execute:
from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import time ua = dict(DesiredCapabilities.PHANTOMJS) ua["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36") service_args = ['--proxy=109.228.147.75:45554','--proxy-type=socks5','--load-images=false','--ignore-ssl-errors=true'] browser = webdriver.PhantomJS(desired_capabilities=ua, service_args=service_args) browser.set_window_size(1920, 1080) browser.get('http://www.ip-adress.com/') time.sleep(10) browser.save_screenshot('screen_test.png') If you use socks5, then when executing the code PhantomJS can not load the site, remaining in limbo, you can wait for eternity and nothing will happen. If you complete the PhantomJS process, then IDLE will abort on the command:
browser.get('http://www.ip-adress.com/') In Mozilla (not in the code, but simply in the window) with the same proxy site opens.
If you change the proxy to https type, then everything will work.
However, through socks5 http://example.com/ is loaded. That is just him. No other site is loading. => Because of this, I suspect that there is a problem with DNS queries, but how to fix this?
Python 3.5 / Selenium 3.0.1 / PhantomJS 2.1.1
