我在python下面编写了这个片段工作得很好我重新启动了我的电脑,现在无论我放什么它立即关闭窗口!我真的需要一些帮助!
from selenium import webdriver
browser = webdriver.Chrome('C:\Users\Jimmy\Downloads\chromedriver.exe')
browser.get('http://www.supremenewyork.com/shop/all')
elem = browser.find_element_by_link_text('mustard')
k=input("press close to exit")
它说File "C:/Users/Jimmy/PycharmProjects/untitled/venv/test.py", line 3
browser = webdriver.Chrome('C:\Users\Jimmy\Downloads\chromedriver.exe')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
答案 0 :(得分:2)
driver = webdriver.Chrome(executable_path=r"<your path>\chromedriver.exe")