Skip to content

Commit

Permalink
Improved detecting loading page for pushing to Archive Today.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Jan 24, 2021
1 parent 17bdfb8 commit 90230c2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions archivenow/handlers/is_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,14 @@ def push(self, uri_org, p_args=[], session=requests.Session()):
# The page takes a while to archive, so keep checking if the loading page is still displayed.
loading = True
while loading:
try:
loadingPage = driver.find_element_by_xpath("/html/body/div/img")

except:

if not 'wip' in driver.current_url:
loading = False

# After the loading screen is gone and the page is archived, the current URL
# will be the URL to the archived page.
print(driver.current_url)

msg = driver.current_url

driver.quit()

except:
Expand Down

0 comments on commit 90230c2

Please sign in to comment.