1

im using web scrapers written in bs4 and selenium, and ive tried to modify the portion in selenium to call and control tor, instead of firefox. im able to open tor browser with selenium, but i always get a message saying my proxy server is refusing connections, so i cant go any further

i originally thought it was an issue with the proxy configuration, but i was able to open tor browser normally through terminal (im running linux), and the proxy settings and other defaults are exactly the same on the working page and the one that doesnt work (the page that my code calls)

here is my code snippet

from selenium import webdriver
from tbselenium.tbdriver import TorBrowserDriver
tbpath='/home// -etc
driver=TorBrowserDriver(tbpath, 
tbb_logfile_path='test.log')
driver.get(url)

this is what the page looks like

enter image description here

this is one thing i've tried using instead, but that opens firefox instead of tor

from selenium.webdriver.firefox.firefox_binary import 
FirefoxBinary

binary=FirefoxBinary("/home/etc) -path to tor

driver=webdriver.Firefox(firefox_binary=binary)

driver.get("url")
kana
  • 11
  • 3

0 Answers0