![](/img/trans.png)
[英]Python selenium function to open a new URL doesn't work with Chrome user profile
[英]Changing the chrome profile, which Selenium uses, doesn't work
當我使用以下代碼運行我的程序時,它會打開一個新選項卡,該選項卡使用來賓帳戶之類的東西。 此外,我無法使用此選項卡登錄任何內容。
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument(r'user-data-dir=C:\Users\Nick\AppData\Local\Google\Chrome\User Data\Profile 1')
driver = webdriver.Chrome(executable_path=r'C:\ChromeDriver\chromedriver.exe', chrome_options=options)
driver.get("https://www.google.com/")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.