Python终端继续关闭,之前工作正常

时间:2018-03-21 23:32:34

标签: python python-3.x selenium-webdriver

我在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

1 个答案:

答案 0 :(得分:2)

driver = webdriver.Chrome(executable_path=r"<your path>\chromedriver.exe")