File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,9 +278,11 @@ def scrape_rme(
278278 if projects_to_add_df .empty :
279279 log .info ("Query to identify projects to scrape returned no results." )
280280 return
281+ log .info (f"Query to identify projects to scrape returned { len (projects_to_add_df )} projects." )
281282 # test a single project
282283 # projects_to_add_df = pd.DataFrame({'project_id': ['5aeff0f8-5a8e-4db8-8e6c-9e507b20eca0']})
283284 count = 0
285+ errors = 0
284286 prg = ProgressBar (projects_to_add_df .shape [0 ], text = "Scrape Progress" )
285287 for project_id in projects_to_add_df ['project_id' ]:
286288 project = rs_api .get_project_full (project_id )
@@ -321,11 +323,14 @@ def scrape_rme(
321323 if delete_downloads_when_done :
322324 delete_folder (download_dir )
323325 count += 1
324- prg .update (count )
326+ prg .update (count + errors )
325327 except Exception as e :
328+ errors += 1
326329 log .error (f'Error scraping HUC { project .huc } : { e } ' )
330+ prg .update (count + errors )
327331 # raise
328332 prg .finish ()
333+ log .info (f"Scraped { count } projects successfully and { errors } failed." )
329334
330335
331336def main ():
You can’t perform that action at this time.
0 commit comments