title: Scrape a website using Selenium and Tor with python 3 on Windows 10
body: <p>I know that there are many threads talking about this but i've tried many of the solutions suggested but nothing seems to work. Im gonna be very specific so you guys could please help me!</p>
  
  <p>Im trying to do web scraping to a website using Selenium in Python 3 on Windows 10. This website blocks me after a certain number of requests so what I've red is that if I use Tor as the Selenium web driver I can just ask Tor for a new identity (which means a different IP) every specific number of requests. </p>
  
  <p>The following code lets me do the scraping I want using Tor firefox profile in the Tor Browser folder. The only thing missing with these code is that I've havent been able to request a new identity (new IP).</p>
  
  <pre><code>profiler = webdriver.FirefoxProfile(r"C:\Users\Samir\Desktop\Tor 
  Browser\Browser\TorBrowser\Data\Browser\profile.default")
  
  profiler.set_preference("network.proxy.type", 1)
  profiler.set_preference("network.proxy.socks",'127.0.0.1')
  profiler.set_preference("network.proxy.socks_port",9050)
  
  driver = webdriver.Firefox(firefox_profile=profiler)
  
  driver.implicitly_wait(15)
  driver.get("The URL I want to scrape")
  
  #Extract whatever information i want from the URL
  </code></pre>
  
  <p>I tried to use the Stem library to get new identity but this does not seem to work with the Tor firefox profile of the previous code.However this works fine if I just open the browser double clicking on the Tor Browser shortcut icon that is created when I install Tor.</p>
  
  <pre><code>#This is the code in stem that gets new identity using Stem. As I said, 
  #this does not work with the selenium firefox profile for Tor. 
  
  from stem import Signal
  from stem.control import Controller
  
  with Controller.from_port(port = 9051) as controller:
  controller.authenticate()
  controller.signal(Signal.NEWNYM)
  </code></pre>
  
  <p>Okay so to wrap up, is there a way to get a new IP with the previous code I showed? Or what can I do to achieve what I want using python 3, selenium and tor on windows 10 plus anyother library or whatever thats necessary.</p>
  
  <p>If you have questions or need more information to help me just let me know.</p>
  
  <p>Thaks a lot!!</p>