def count(self):
"""
"""
time.sleep(SLEEP)
self.click()
time.sleep(SLEEP) # wait for server response
option_path = self.path + '/span[@data-value]'
try:
WebDriverWait(self.driver, TIMEOUT).until(
EC.presence_of_element_located((By.XPATH, option_path))
)
options = self.driver.find_elements_by_xpath(option_path)
return len(options)
except (TimeoutException, socket.timeout):
return 0
评论列表
文章目录