I'm attempting to automate the use of the Tor browser through selenium:
import time
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = '/Applications/TorBrowser.app/Contents/MacOS/firefox'
firefox_binary = FirefoxBinary(binary)
try:
driver = webdriver.Firefox(firefox_binary="/Applications/Tor Browser.app/Contents/MacOS/firefox")
driver.get("https://www.google.com/")
time.sleep(3)
finally:
driver.close()
I am trying to use Tor browser for scraping and everything works fine, but every time I run code you have to manually click connect button. How do I disable the confirmation screen or automatic its acceptance from within selenium?