Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在python中打开一个已经登录到google的chrome配置文件_Python_Selenium - Fatal编程技术网

在python中打开一个已经登录到google的chrome配置文件

在python中打开一个已经登录到google的chrome配置文件,python,selenium,Python,Selenium,我正试图打开我的chrome档案,这是登录到谷歌,但我没有任何运气 from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument(r'user-data- dir=G:\Users\Kareem\AppData\Local\Google\Chrome\User Data\Profile 10') chrome_path= r"G:\Users\Kareem\Documents\Wor

我正试图打开我的chrome档案,这是登录到谷歌,但我没有任何运气

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument(r'user-data-
dir=G:\Users\Kareem\AppData\Local\Google\Chrome\User Data\Profile 10')
chrome_path= r"G:\Users\Kareem\Documents\Work\Computer 
Science\Selenium\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get("https://www.google.co.uk/webhp?source=search_app")
创建驱动程序时,实际上并没有将选项传递给它

driver = webdriver.Chrome(chrome_options=options)

我在代码中添加了“抱歉,我没看到”。当它打开新标签,我点击管理人员时,它会显示默认和来宾,而不是我所有的chrome配置文件。在chrome版本中,它有我加上默认值的路径。基本上,我试图让它打开我的正常chrome档案,登录到谷歌和特定网站,以便我可以使用自动化