Unable to Start tor using Python Selenium Error: failed to start

0 votes
from selenium import webdriver

from selenium.webdriver.firefox.firefox_profile import FirefoxProfile

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary(r'C:\Users\DJ\Desktop\Tor Browser\Browser\firefox.exe')

profile = FirefoxProfile(r"C:\Users\DJ\Desktop\Tor Browser\Browser\TorBrowser\Data\Browser\profile.default")

driver = webdriver.Firefox(profile, binary)

driver.get("http://stackoverflow.com")

A window from tor pops up saying "Tor failed to start" I press OK then it says, "Could not connect to tor control port'. Please help in this matter.Thank you

Jun 29, 2018 in Selenium by Martin
• 4,220 points
795 views

1 answer to this question.

0 votes

I tried to solve same problem on windows:

from selenium import webdriver

from selenium.webdriver.firefox.firefox_profile import FirefoxProfile

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary(r"C:\Users\<Windows User>\Desktop\Tor Browser\Browser\firefox.exe")

# start driver without a profile

driver = webdriver.Firefox(firefox_binary=binary)

# configured profile settings

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', 9051)

driver.get("http://stackoverflow.com")
answered Jun 29, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer

Headless ChromeDriver using Python Selenium error: Fails To Start— “DevTools request failed”

This should be because your ChromeDriver is ...READ MORE

answered Mar 29, 2018 in Selenium by nsv999
• 5,110 points
392 views
0 votes
1 answer
0 votes
2 answers

Unable to Click on an Element in Selenium (Python) even after finding it.

Here, I give you working script which ...READ MORE

answered Sep 19, 2018 in Selenium by Priyaj
• 56,900 points
8,712 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
935 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,117 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
856 views
0 votes
1 answer

Error: unable to add browser extension to Firefox profile using Selenium

Try to create profile on Firefox browser ...READ MORE

answered Jul 11, 2018 in Selenium by Samarpit
• 5,130 points
589 views
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,130 points
345 views