title: Accessing Tor with Selenium in Python
body: <p>I've tried a multitude of solutions to this, but so far haven't had any luck.  I'm trying to access the tor browser using selenium in python, but when my program opens up Tor, Tor gives me an error message saying:</p>
  
  <pre><code>Tor failed to start.  
  </code></pre>
  
  <p>Python then gives the following error message:</p>
  
  <pre><code>selenium.common.exceptions.WebDriverException: Message: permission denied
  </code></pre>
  
  <p>My code is the following:</p>
  
  <pre><code>binary = FirefoxBinary(r"C:\\Users\\User\\Desktop\\Tor Browser\\Browser\\firefox.exe")
  profile = FirefoxProfile(r"C:\\Users\\User\\Desktop\\Tor Browser\\Browser\\TorBrowser\\Data\\Browser\\profile.default")
  
  driver = webdriver.Firefox(firefox_binary=binary)
  driver = webdriver.Firefox(firefox_profile= profile, firefox_binary= binary, executable_path = r"C:\\Users\\User\\Desktop\\geckodriver.exe")
  driver.profile.set_preference('network.proxy.type', 1)
  driver.profile.set_preference('network.proxy.socks', '127.0.0.1')
  driver.profile.set_preference('network.proxy.socks_port', 9150)
  profile.set_preference("network.proxy.socks_remote_dns", False)
  profile.update_preferences()
  driver.get("http://yahoo.com")
  </code></pre>
  
  <p>Any help on this would be greatly appreciated!</p>