【发布时间】:2020-06-16 23:04:56
【问题描述】:
我正在尝试使用 Selenium 为我的下载设置一个新的下载文件夹,但出现错误。
我正在使用:
options.add_argument('download.default_directory = C:\Users\User\Documents\folder')
我得到的错误
File "C:/Users/GuilhermeMachado/PycharmProjects/untitled/Extranet_BTG.py", line 29
options.add_argument('download.default_directory = C:\Users\User\Documents\folder')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 31-32: truncated \UXXXXXXXX escape
这有什么问题?
【问题讨论】:
-
@Guy 添加多个与 python 相关的标签是没有意义的,例如python、python-3.x、python-2.7 等针对一个问题。它不会增加任何价值。
-
@DebanjanB 所以删除
python-3如果你删除了某些东西,它是特定于版本的,而不是特定于语言的。
标签: python selenium selenium-chromedriver