代码如图
wait = WebDriverWait(self.browser,20)
wait.until(EC.element_to_be_clickable((By.ID,'city')))
self.browser.find_element_by_xpath('//*[@id="city"]/li[2]').click()
log报的错误是找不到元素city,我查看了self.browser的sourcepage属性,是有id属性为city的元素的.
ringa_lee2017-04-17 17:26:32
더 구체적인 xpath를 작성하세요. 예: "/img[@src='images/sidebar/icon-nav-white-community.879b43c0.svg']"