本文整理汇总了Python中notifier.Notifier.deliver方法的典型用法代码示例。如果您正苦于以下问题:Python Notifier.deliver方法的具体用法?Python Notifier.deliver怎么用?Python Notifier.deliver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notifier.Notifier
的用法示例。
在下文中一共展示了Notifier.deliver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Exception
# 需要导入模块: from notifier import Notifier [as 别名]
# 或者: from notifier.Notifier import deliver [as 别名]
while 1:
subject = "[PASSAGENS SUBMARINOVIAGENS]"
try:
while driver.find_element_by_id("btnBestPriceNoStop").text == '':
contador += 1
time.sleep(5)
if contador > 10:
raise Exception('Maximo de tentativas excedidas para tentar o preço')
valor = driver.find_element_by_id("btnBestPriceNoStop").text
ultimo_valor = ''
try:
ultimo_valor = open('ultimo_valor', 'r').readline()
except IOError:
print "Nao existe valor anterior"
f = open('ultimo_valor', 'w')
f.write(valor)
if ultimo_valor is None or ultimo_valor != valor:
conteudo = driver.find_element_by_id("divMatrixPrice").text
subject = "%s %s" % (subject, valor)
email.deliver(subject,conteudo)
except:
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2, file=sys.stdout)
email.deliver(subject + "HOUVE UM ERRO AO PROCESSAR SEU PREÇO")
driver.quit()
time.sleep(600)