51Testing软件测试论坛
标题:
Day4-1测试积点任务
[打印本页]
作者:
测试积点老人
时间:
2018-5-10 14:10
标题:
Day4-1测试积点任务
问题:
求助:python+selenium 启动 Chrome 时,加载用户配置文件,启动报错
依照网上的设置,代码如下:
<font face="微软雅黑" size="3">from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--profile-directory=Default')
options.add_argument('--user-data-dir=C:\Users\admin\AppData\Local\Google\Chrome\User Data\Profile 4')
browser = webdriver.Chrome(chrome_options=options)
报错信息如下:
Traceback (most recent call last):
File "C:/Users/admin/PycharmProjects/testdemo/555.py", line 11, in
browser = webdriver.Chrome(chrome_options=options)
File "C:\Python27\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in init
desired_capabilities=desired_capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 92, in init
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 238, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 193, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot create default profile directory
(Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)</font>
复制代码
作者:
abcsell
时间:
2018-5-17 09:21
应该是没有响应
作者:
qqq911
时间:
2018-5-17 10:11
兼容性问题?
作者:
jingzizx
时间:
2018-5-17 10:19
看不出来,还有其他的吗
作者:
梦想家
时间:
2018-5-17 11:16
兼容性问题?
作者:
libingyu135
时间:
2018-5-17 14:20
无法创建默认配置文件目录,是不是啥东西没配好
作者:
libingyu135
时间:
2018-5-17 14:20
无法创建默认配置文件目录,是不是啥东西没配好
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2