if last_entry_index == 0: print("found at 0 quit..") # found the last entry at the 1st position from this call. # nothing to do break else: # found it at some index other than 0 # print("found it... at ", last_entry_index) latest_filings = latest_filings[0:last_entry_index] # all_latest_filings += latest_filings print_filing(latest_filings) filingsDb.insertRecentFilings(latest_filings) # submit to filings queue AWSUtil.push_to_filings_queue(latest_filings, cik_followers) break except ValueError: # there isn't one found on this batch. filingsDb.insertRecentFilings(latest_filings) # submit to filings queue AWSUtil.push_to_filings_queue(latest_filings, cik_followers) # continue on to next page, but sleep for a quick sec. time.sleep(1) continue else: print("No more entries available") break