Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't launch Tor Browser with the specified ExitNodes #208

Open
mtrfnvwork opened this issue Jun 14, 2024 · 0 comments
Open

Can't launch Tor Browser with the specified ExitNodes #208

mtrfnvwork opened this issue Jun 14, 2024 · 0 comments

Comments

@mtrfnvwork
Copy link

mtrfnvwork commented Jun 14, 2024

When I try to run this script:

import tempfile
from time import sleep

import tbselenium.common as cm
from tbselenium.tbdriver import TorBrowserDriver
from tbselenium.utils import launch_tbb_tor_with_stem

TBB_PATH = "/home/ubuntu/Desktop/tor-browser"

torrc = {
    'ControlPort': str(cm.STEM_CONTROL_PORT),
    'SOCKSPort': str(cm.STEM_SOCKS_PORT),
    'DataDirectory': tempfile.mkdtemp(),
    'ExitNodes': '{ru} StrictNodes 1'
}

tor_process = launch_tbb_tor_with_stem(tbb_path=TBB_PATH,
                                       torrc=torrc)

with TorBrowserDriver(TBB_PATH, tor_cfg=cm.USE_STEM) as driver:
    driver.load_url("https://2ip.ru")
    sleep(1000)

tor_process.kill()

I get the following error:
OSError: reached a 90 second timeout without success

But if I comment the line
ExitNodes': '{ru} StrictNodes 1'

It works well

How can I set ExitNodes to launch TorBrowserDriver with the specified country?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant