Skip to content

Instantly share code, notes, and snippets.

@ShlomiRex
Created October 30, 2021 22:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShlomiRex/1d9d7b7b341d8af535b53c657309fcad to your computer and use it in GitHub Desktop.
Save ShlomiRex/1d9d7b7b341d8af535b53c657309fcad to your computer and use it in GitHub Desktop.
Python Selenium - Brave + Tor
_brave_path = r'C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe'
def get_brave_tor_driver():
option = webdriver.ChromeOptions()
option.binary_location = _brave_path
option.add_argument("--tor") # Launch in Tor mode
driver = webdriver.Chrome(executable_path=_chrome_driver_path, chrome_options=option)
return driver
@ShlomiRex
Copy link
Author

It should open 1 window only in Tor mode. Didn't encountered this issue before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment