chromedriver = webdriver.Chrome('C:\Python3\chromedriver.exe')
#os.environ["webdriver.chrome.driver"] = chromedriver
chrome_options = Options()
# this is the preference we're passing
prefs = {"download.default_directory" : "F:/"}
chrome_options.add_experimental_option("prefs", prefs)
#driver = webdriver.Chrome(chrome_options=chrome_options)
chromedriver.get("{some website which has the element with ID xxxx_TxtSearch}")
num = chromedriver.find_element_by_xpath("//*[contains(@id, 'TxtSearch')]")
最后一行产生以下错误。附上截图供参考。我相信直到昨天才会出现任何问题,并且chromedriver出现在指定地点。
答案 0 :(得分:0)
我和chromedriver 2.25有同样的问题
升级到2.35并解决问题。