Log error before retry
This commit is contained in:
parent
acaa93cf47
commit
34008046b2
@ -46,8 +46,10 @@ def update_other_applications():
|
|||||||
min(search_past_week + search_num_weeks, 9)): # Council only allow latest 9 weeks
|
min(search_past_week + search_num_weeks, 9)): # Council only allow latest 9 weeks
|
||||||
try:
|
try:
|
||||||
weekly_list.scrape(_browser, search_week_idx)
|
weekly_list.scrape(_browser, search_week_idx)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# try one more time
|
print(f'Error found: {repr(e)}')
|
||||||
|
print(traceback.format_exc())
|
||||||
|
print("Try again")
|
||||||
weekly_list.scrape(_browser, search_week_idx)
|
weekly_list.scrape(_browser, search_week_idx)
|
||||||
|
|
||||||
there_were_newly_decided_applications = len(weekly_list.new_applications) > 0
|
there_were_newly_decided_applications = len(weekly_list.new_applications) > 0
|
||||||
@ -66,8 +68,10 @@ def update_other_applications():
|
|||||||
_app = Application(_cursor, application_ref)
|
_app = Application(_cursor, application_ref)
|
||||||
try:
|
try:
|
||||||
_app.scrape_portal(_browser)
|
_app.scrape_portal(_browser)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# try one more time
|
print(f'Error found: {repr(e)}')
|
||||||
|
print(traceback.format_exc())
|
||||||
|
print("Try again")
|
||||||
_app.scrape_portal(_browser)
|
_app.scrape_portal(_browser)
|
||||||
|
|
||||||
if _app.caseOfficer == "Christopher Masters":
|
if _app.caseOfficer == "Christopher Masters":
|
||||||
@ -95,8 +99,10 @@ if __name__ == '__main__':
|
|||||||
with webdriver.Chrome(options=web_opts) as browser:
|
with webdriver.Chrome(options=web_opts) as browser:
|
||||||
try:
|
try:
|
||||||
application.scrape_portal(browser, force=True, count_documents=True)
|
application.scrape_portal(browser, force=True, count_documents=True)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# try one more time
|
print(f'Error found: {repr(e)}')
|
||||||
|
print(traceback.format_exc())
|
||||||
|
print("Try again")
|
||||||
application.scrape_portal(browser, force=True, count_documents=True)
|
application.scrape_portal(browser, force=True, count_documents=True)
|
||||||
|
|
||||||
if application.new_documents_found:
|
if application.new_documents_found:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user