From fc5a874190406540673b313544baeecda348e29b Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Mon, 17 Jul 2017 18:29:54 +0200 Subject: [PATCH] Actually, this should be better. --- readit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readit.py b/readit.py index 282f5ee..bc3fb0c 100755 --- a/readit.py +++ b/readit.py @@ -45,10 +45,11 @@ def login(driver): return True def pageHandler(driver, id, page): - while not loadPage("https://app.myreadit.com/reader/%s#%i" % (id, int(page)), driver): + if not loadPage("https://app.myreadit.com/reader/%s#%i" % (id, int(page)), driver): if not loadPage("https://app.myreadit.com/reader/%s#%i" % (id, int(page) + 2), driver): return False - time.sleep(10) + while not loadPage("https://app.myreadit.com/reader/%s#i" % (id, int(page)), driver): + time.sleep(5) img = driver.find_element_by_id("page1").get_attribute("src") helpers.downloadPage(img, id, page, helpers.JPG)