本文整理汇总了Python中selenium.webdriver.support.ui.WebDriverWait.next方法的典型用法代码示例。如果您正苦于以下问题:Python WebDriverWait.next方法的具体用法?Python WebDriverWait.next怎么用?Python WebDriverWait.next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.webdriver.support.ui.WebDriverWait
的用法示例。
在下文中一共展示了WebDriverWait.next方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sell_orders
# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import next [as 别名]
def sell_orders():
scroll_down()
#xpath = '//tr[contains(@class,"sell_tr")]'
while True:
logging.debug("Getting sell rows")
xpath = '//table[@id="md-sell"]/tbody/tr[position() <= 5]'
trs = WebDriverWait(driver, 20).until(
EC.presence_of_all_elements_located((By.XPATH, xpath)))
trs = reversed(trs)
logging.debug("Looping through rows")
try:
tr = trs.next()
_tds = tr.find_elements_by_tag_name('td')
tds = []
print "tds = {0}".format(pp.pformat(_tds))
for td in _tds:
tds.append(float(td.text))
so = SellOrder(*tds[0:2])
logging.debug("yielding sell order: {0}".format(so))
yield so
except StaleElementReferenceException:
logging.debug("StaleElementReferenceException!")
continue
示例2: sell_orders
# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import next [as 别名]
def sell_orders():
scroll_down()
#xpath = '//tr[contains(@class,"sell_tr")]'
xpath = '//table[@id="md-sell"]/tbody/tr'
print 1
trs = WebDriverWait(driver, 90).until(
EC.presence_of_all_elements_located((By.XPATH, xpath)))
trs = iter(trs)
while True:
try:
tr = trs.next()
_tds = tr.find_elements_by_tag_name('td')
tds = []
print "tds = {0}".format(pp.pformat(_tds))
for td in _tds:
tds.append(float(td.text))
so = SellOrder(*tds[0:2])
yield so
except StaleElementReferenceException:
continue
except StopIteration:
pass