Skip to content Skip to sidebar Skip to footer

Loading Selenium User Profile In Tor Chrome On Windows

This code works for Windows where it launches Chrome connected via Tor. Keep in mind you have to have Tor browser running beforehand. How can I enable the user-profile and start th

Solution 1:

Use this instead.

chrome_options.add_argument("user-data-dir=C:\\Users\\user\\AppData\\Local\\Google\\Chrome\\User Data")

you don't have to specify the profile directory (Default) as it is used by default if nothing is explicitly specified using below code. SO in your case use only the above line of code

chrome_options.add_argument("profile-directory=Profile 1")

Eg:

from selenium import webdriver
from selenium.webdriver.support.ui import Select
import time
from selenium.webdriver.chrome.options import Options
   
options = Options()
options.add_argument(r"user-data-dir=C:\Users\prave\AppData\Local\Google\Chrome\User Data")
    
driver =webdriver.Chrome("./chromedriver.exe",options=options)

driver.get(url)

Output:

enter image description here

Post a Comment for "Loading Selenium User Profile In Tor Chrome On Windows"