Code: Select all
def setup_profile(profile_name):
enter code here`profiles_dir = os.path.join(os.getcwd(), "profiles")
os.makedirs(profiles_dir, exist_ok=True)
user_data_dir = os.path.join(profiles_dir, profile_name)
options = Options()
options.binary_location = chromium_path
options.add_argument(f"--user-data-dir={user_data_dir}")
options.add_argument(f"--profile-directory={profile_name}")
options.add_argument("--disable-web-security")
options.add_argument("--allow-running-insecure-content")
options.add_argument("--no-sandbox")
options.add_argument("--enable-chrome-browser-cloud-management")
options.add_argument("--force-dev-mode-highlighting")
options.headless = False
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(service=Service(ChromeDriverManager(chrome_type="chromium").install()), options=options)
Geben Sie hier die Bildbeschreibung ein