Skip to content

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

@mtrfnvwork

Description

@mtrfnvwork

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions