mirror of
				https://github.com/KevinMidboe/ITLscraper.git
				synced 2025-10-29 17:50:14 +00:00 
			
		
		
		
	add error handling
This commit is contained in:
		| @@ -244,6 +244,9 @@ class itslearning_scraper(): | |||||||
|                 #print(link) |                 #print(link) | ||||||
|                 itl_path = os.path.join(os.path.abspath(os.path.curdir)) |                 itl_path = os.path.join(os.path.abspath(os.path.curdir)) | ||||||
|                 title = link.contents[0] |                 title = link.contents[0] | ||||||
|  |                 if not title: | ||||||
|  |                     title = "Failed to name"+str(self.failure) | ||||||
|  |                     self.failure +=1 | ||||||
|                 make_folder(itl_path, title) |                 make_folder(itl_path, title) | ||||||
|                 r = rq.get(base_url+link.get("href"), cookies=self.cookies) |                 r = rq.get(base_url+link.get("href"), cookies=self.cookies) | ||||||
|                 table = self.find_folder_table(r.text) |                 table = self.find_folder_table(r.text) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user