Created
October 30, 2021 22:56
-
-
Save ShlomiRex/1d9d7b7b341d8af535b53c657309fcad to your computer and use it in GitHub Desktop.
Python Selenium - Brave + Tor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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 |
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
Hello! Thank you for this trick!
One question. I'm having an issue where the driver opens two windows, and it says that the client is blocking the content. I can only interact from it until it has secured the Tor connection, and only if I close the second window. Have you encountered the same issue?