driver = webdriver.chrome
driver.set_page_load_timeout("10")
driver.get("https://www.google.com/")
driver.find_element_by_name("q").send_keys("selenium")
driver.find_element_by_name("btnK").click()
time.sleep(4)
0driver.quit()
此程序给出错误,因为“ unicodeescape”编解码器无法解码位置2-3中的字节:\ UXXXXXXXX转义被截断”
请提出建议
错误消息:
C:\Users\praveen\PycharmProjects\sel\venv\Scripts\python.exe C:/Users/praveen/PycharmProjects/sel/one.py
File "C:/Users/praveen/PycharmProjects/sel/one.py", line 4
driver = webdriver.chrome("C:\Users\praveen\PycharmProjects\sel\drv\chromedriver.exe")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
以退出代码1完成的过程