Selenium webdriver not opening websites in default chrome profile

懵懂的女人 提交于 2020-02-28 23:17:32

问题


I have tried selenium webdriver in Python and it works fine. But when I try to open default chrome profile it doesn't open the websites.

The code is

chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument("user-data-
dir=/Users/prajwal/Library/Application Support/Google/Chrome")
capability = DesiredCapabilities.CHROME
capability["pageLoadStrategy"] = "normal"
driver = webdriver.Chrome(desired_capabilities=capability, 
chrome_options=chromeOptions)
driver.get("https://www.google.com")

The window opens in this case. But it doesnt open the website. However, it works fine if I remove

chromeOptions.add_argument("user-data-
dir=/Users/prajwal/Library/Application Support/Google/Chrome")

Where am I going wrong ?

来源:https://stackoverflow.com/questions/48861378/selenium-webdriver-not-opening-websites-in-default-chrome-profile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!