0

I am trying to use Proxy which has user and password but it is not working and showing the real IP. Code given below:

    PROXY_HOST = "xxx.xxx.xxx.xxx"
    PROXY_PORT = 60000

    profile = webdriver.FirefoxProfile()
    profile.set_preference("network.proxy.type", 1)
    profile.set_preference("network.proxy.http", PROXY_HOST)
    profile.set_preference("network.proxy.http_port", PROXY_PORT)
    profile.set_preference("network.proxy.socks_username", "user")
    profile.set_preference("network.proxy.socks_password", "pwd")

    profile.update_preferences()

    driver = webdriver.Firefox(firefox_profile=profile)
    driver.maximize_window()
    driver.get('https://httpbin.org/ip')
    html = driver.page_source
    print(html)

The Proxy IP itself is working as I verified it by using Python requests library.

Volatil3
  • 14,253
  • 38
  • 134
  • 263
  • You do know that SOCKS is not the same thing as HTTP, right? Why are you setting the socks password? – Burhan Khalid Jul 09 '17 at 07:45
  • @BurhanKhalid what am I supposed to use then? – Volatil3 Jul 09 '17 at 07:47
  • @BurhanKhalid Provide me the answer rather questioning me. There is no such thing as `proxy.http_username` – Volatil3 Jul 09 '17 at 07:52
  • The last sentence of your post doesn't make sense grammatically. Even when `access` is changed into `accessed` it is not an interrogative sentence, so ending that statement with a question mark is inappropriate. We should not have to guess what you are asking, so please update your post with a real question (e.g. "If I change to using java, would I run into the same problems with selenium?") Please don't comment on this comment, just directly update your post to make it acceptable on [so] – Anthon Jul 09 '17 at 08:31
  • @Anthon fixed it. – Volatil3 Jul 09 '17 at 09:14
  • There is not a Single acceptable answer in the post linked here for duplication and even the solution is not working. – Volatil3 Jul 09 '17 at 09:20

0 Answers0