Actually, this should be better.

This commit is contained in:
Klaus-Uwe Mitterer 2017-07-17 18:29:54 +02:00
parent efb3754b83
commit fc5a874190

View file

@ -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)