本文整理汇总了Python中selenium.webdriver.support.ui.WebDriverWait.pop方法的典型用法代码示例。如果您正苦于以下问题:Python WebDriverWait.pop方法的具体用法?Python WebDriverWait.pop怎么用?Python WebDriverWait.pop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.webdriver.support.ui.WebDriverWait
的用法示例。
在下文中一共展示了WebDriverWait.pop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import pop [as 别名]
def run(self):
logging.info("RODANDO...") if debug else ''
driver = self.driver
partidas = WebDriverWait(driver, WEB_DRIVE_WAIT).until(
lambda driver: driver.find_elements_by_class_name("ipo-Fixture_Truncator")
)
[partidas.pop() for _ in range(POP_LIST)]
indice = 0
jogos = []
for jogo in partidas:
indice += 1
jogos.append({"equipe": unicode(jogo.text), "indice": indice})
for i in jogos:
logging.info("[%s] EQUIPE ENCONTRADA" % i) if debug else ''
print("[%d] PARTIDAS ENCONTRADAS") % (indice / 2)
logging.info("[%d] PARTIDAS ENCONTRADAS" % (indice / 2)) if debug else ''
self.get_fucking_informations()
cont_jogo = 1
print("JOGOS RIPADOS [%d]" % cont_jogo)
logging.info("JOGOS RIPADOS [%d]" % cont_jogo) if debug else ''
passo = 0
tentativa = 0
for _ in xrange(len(partidas)):
time.sleep(1)
partidas = WebDriverWait(driver, WEB_DRIVE_WAIT).until(
lambda driver: driver.find_elements_by_class_name("ipo-Fixture_Truncator")
)
[partidas.pop() for _ in range(POP_LIST)]
try:
partidas[jogos[passo]['indice']].click()
except:
break
time.sleep(1)
try:
self.get_fucking_informations()
cont_jogo += 1
passo += 2
print("JOGOS RIPADOS [%d]" % cont_jogo)
logging.info("JOGOS RIPADOS [%d]" % cont_jogo) if debug else ''
except Exception, e:
logging.error("ERRO NA HORA DE PEGAR AS INFORMAÇOES DOS JOGOS: %s" % e) if debug else ''
tentativa += 1
if tentativa > 2:
passo += 2
pass
back = self.driver.find_element_by_class_name("ipe-EventViewTitle_Back")
back.click()