Change IP Address Python Selenium
<p>I Try run code with Python Selenium</p>

<pre><code>from selenium import webdriver
import time

profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy_type",1)
profile.set_preference("network.proxy.http","124.240.187.80")
profile.set_preference("network.proxy.http_port",82)
profile.update_preferences()

driver=webdriver.Firefox(firefox_profile=profile)
driver.get('https://www.whatismyip.com/')
driver.sleep(3)
driver.close()
</code></pre>

<p>But my IP address does not change when you run this file.</p>

<p>How can I change my ip address. I am developing a web crawler and need to change the ip</p>

<p>Use desired capabilities for FF.</p>

<pre><code>proxy = "124.240.187.80:82"

webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
   "httpProxy":proxy,
   "ftpProxy":proxy,
   "sslProxy":proxy,
   "noProxy":None,
   "proxyType":"MANUAL",
   "class":"org.openqa.selenium.Proxy",
   "autodetect":False
}
</code></pre>

<p><a href="http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp#using-a-proxy" rel="nofollow">WebDriver: Advanced Usage - proxy</a></p>

python selenium proxy web-crawler