Unable to connect to Tor-Firefox via Watir

I'm having trouble connecting to Tor through the Ruby-Watir webdriver.

I am using the Tor Browser package. The problem is that when I try to connect via Watir (Selenium), I cannot open Tor instead of regular Firefox.

Looking at similar problems, I tried the following:

require 'watir-webdriver'

profile = Selenium::WebDriver::Firefox::Profile.new

profile['network.proxy.socks'] = '127.0.0.1' #the proxy tor uses
profile['network.proxy.socks_port'] = 9150 #I cannot use 9050, 9150 works when I use Tor
profile['network.proxy.type'] = 1

browser = Watir::Browser.new :firefox, :profile => profile
browser.goto [an .onion website]

When I use the previous code, I still still open the regular Firefox browser and cannot connect to the onion sites.

Any thoughts? Is there any other way to connect Tor browser to my webdriver profile?

+4
source share
2 answers

Answer:

Tor ( ). :

Selenium::WebDriver::Firefox::Binary.path='{location of start_tor_browser*}'
browser = Watir::Browser.new :firefox

* : ///-browser_en-US/ TOR-

-

+4

,

0

Source: https://habr.com/ru/post/1545221/


All Articles