From 631b88e915befacad4994cabb757f905b4af6398 Mon Sep 17 00:00:00 2001 From: sigvartmh Date: Fri, 12 May 2017 14:29:20 +0200 Subject: [PATCH] add error handling --- itl_scrape.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/itl_scrape.py b/itl_scrape.py index edade56..95fadb6 100644 --- a/itl_scrape.py +++ b/itl_scrape.py @@ -244,6 +244,9 @@ class itslearning_scraper(): #print(link) itl_path = os.path.join(os.path.abspath(os.path.curdir)) title = link.contents[0] + if not title: + title = "Failed to name"+str(self.failure) + self.failure +=1 make_folder(itl_path, title) r = rq.get(base_url+link.get("href"), cookies=self.cookies) table = self.find_folder_table(r.text)