webfp / tor-browser-selenium

Tor Browser automation with Selenium.
MIT License
528 stars 101 forks source link

how to run tor on port 9050?! #173

Closed sova32 closed 2 years ago

sova32 commented 2 years ago

i do:

from tbselenium.tbdriver import TorBrowserDriver
with TorBrowserDriver("/path/to/TorBrowserBundle/") as driver:
    driver.get('https://check.torproject.org')

i have:

/run/media/vadiki/D_238_GB_WD/Projects/python/anonimous_mail_sender/venv/bin/python /run/media/vadiki/D_238_GB_WD/Projects/python/anonimous_mail_sender/main.py
Traceback (most recent call last):
  File "/run/media/vadiki/D_238_GB_WD/Projects/python/anonimous_mail_sender/main.py", line 2, in <module>
    with TorBrowserDriver("/home/vadiki/Browser/") as driver:
  File "/run/media/vadiki/D_238_GB_WD/Projects/python/anonimous_mail_sender/venv/lib/python3.8/site-packages/tbselenium/tbdriver.py", line 54, in __init__
    self.setup_tbb_paths(tbb_path, tbb_fx_binary_path,
  File "/run/media/vadiki/D_238_GB_WD/Projects/python/anonimous_mail_sender/venv/lib/python3.8/site-packages/tbselenium/tbdriver.py", line 171, in setup_tbb_paths
    raise TBDriverPathError("Invalid Firefox binary %s"
tbselenium.exceptions.TBDriverPathError: Invalid Firefox binary /home/vadiki/Browser/Browser/firefox

Process finished with exit code 1

how to run tor on port 9050?! where is documentation?!

gunesacar commented 2 years ago

You should rather use a Tor controller library such as stem to run and configure tor. See, also: https://github.com/webfp/tor-browser-selenium/blob/main/examples/stem_adv.py#L33