1

Every time I want to run my Program Tor crashes. The Code has no errors. And the Paths are all correct. Here is my Code:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
import os

torexe = os.popen(r'C:/Users/Seya Fässler/Desktop/Tor Browser/Browser/TorBrowser/Tor/tor.exe')
profile = FirefoxProfile(r'C:/Users/Seya Fässler/Desktop/Tor Browser/Browser/TorBrowser/Data/Browser/profile.default')
profile.set_preference('network.proxy.type', 1)
profile.set_preference('network.proxy.socks', '127.0.0.1')
profile.set_preference('network.proxy.socks_port', 9050)
profile.set_preference("network.proxy.socks_remote_dns", False)
profile.update_preferences()


firefox_options = webdriver.FirefoxOptions()
firefox_options.binary_location = r'C:/Users/Seya Fässler/Desktop/Tor Browser/Browser/firefox.exe'
driver = webdriver.Firefox(firefox_profile= profile, options = firefox_options, executable_path=r'C:/Users/Seya Fässler/Webdrivers/geckodriver.exe')
driver.get("https://www.apple.com")

After that, it shows up this Alert:

Tor Alert

When I press OK it opens this window and I can't copy the log, because it has 0 lines.

Tor Alert 2

I use Windows 10, as an environment I use anaconda, the tor browser is on the newest version (9.5.3) and I use Python 3.8.3. Please don't delete my question because of duplicates, the other question has an answer but only in C#, and it doesn't work with python! Thanks!

Lowity_2
  • 29
  • 4
  • There is absolutely no use in raising the same question and deleting it again and again. Instead edit the first question with all the required info and send a message to the contributor who have closed the other question appending `@` before the username, so your question can be `ReOpened` – undetected Selenium Jul 31 '20 at 08:43
  • Ok, i will do that. How can i see who has closed my question. And another question on your Post somebody has answered in C#, do you have the code in Python? – Lowity_2 Jul 31 '20 at 08:46
  • I have added another dup target of a working and accepted answer. Let me know if that address your question. – undetected Selenium Jul 31 '20 at 08:51
  • @DebanjanB It starts Firefox not tor. It doesn't work – Lowity_2 Jul 31 '20 at 08:56
  • [TOR](https://tor.stackexchange.com/questions/21383/what-is-the-difference-between-the-tor-browser-initiated-by-firefox-v68-9-0esr-a) project can be implemented using either of the of the _Browsing Contexts_ e.g. _Firefox_, _Firefox Nightly_, _Chrome_, _Brave_ depending on your requirement. The default manual implementation is through _Firefox ESR_ which isn't compatible with WebDriver specs. Hence the error. – undetected Selenium Jul 31 '20 at 09:04
  • @DebanjanB Ok, thanks! What would you choose? – Lowity_2 Jul 31 '20 at 09:08
  • Well, I'm all over. As a contributor to [GeckoDriver](https://stackoverflow.com/questions/45329528/which-firefox-browser-versions-supported-for-given-geckodriver-version/45331403#45331403) and production environment is concerned, I use [Mozilla Firefox](https://stackoverflow.com/questions/45329528/which-firefox-browser-versions-supported-for-given-geckodriver-version/45331403#45331403) as that's well maintained. – undetected Selenium Jul 31 '20 at 09:17
  • @DebanjanB and have you an working example? With tor implementation and Firefox, Python – Lowity_2 Jul 31 '20 at 09:17
  • As a contributor to [Firefox](https://stackoverflow.com/questions/45329528/which-firefox-browser-versions-supported-for-given-geckodriver-version/45331403#45331403) for research and development, I use [Firefox Developer Edition](https://stackoverflow.com/questions/54754686/how-to-open-firefox-developer-edition-through-selenium/54762442#54762442) or _Firefox Nightly_. – undetected Selenium Jul 31 '20 at 09:22
  • @DebanjanB Thanks for your Help, it was really helpful. But do you have an tutorial how i can implement Tor in Firefox – Lowity_2 Jul 31 '20 at 09:48
  • Doesn't [this](https://stackoverflow.com/questions/53942553/how-to-connect-to-tor-browser-using-python) and [this](https://stackoverflow.com/questions/62666075/how-to-initiate-a-tor-browser-9-5-which-uses-the-default-firefox-to-68-9-0esr-us) solution works for you using _Mozilla Firefox_ and _Firefox Nightly_? – undetected Selenium Jul 31 '20 at 10:15
  • @DebanjanB it has this error and opens nothing: selenium.common.exceptions.WebDriverException: Message: Acces denied (os error 5) and im pretty sure that the paths are correct – Lowity_2 Jul 31 '20 at 12:09

0 Answers0