mirror of
				https://github.com/KevinMidboe/ITLscraper.git
				synced 2025-10-29 17:50:14 +00:00 
			
		
		
		
	Merge pull request #1 from hernil/master
Quickfix for slash in note names
This commit is contained in:
		| @@ -224,9 +224,15 @@ class itslearning_scraper(): | |||||||
|         text = self.html2text.handle(str(text)) |         text = self.html2text.handle(str(text)) | ||||||
|         fp = os.path.join(os.path.abspath(os.path.curdir), title) |         fp = os.path.join(os.path.abspath(os.path.curdir), title) | ||||||
|         #convert to md? |         #convert to md? | ||||||
|         with open(fp+".md", "wb") as note: |         try: | ||||||
|             note.write(bytes(text.encode("utf-8"))) |             with open(fp+".md", "wb") as note: | ||||||
|             note.close() |                 note.write(bytes(text.encode("utf-8"))) | ||||||
|  |                 note.close() | ||||||
|  |         except FileNotFoundError: | ||||||
|  |             if "/" in title: | ||||||
|  |                 print("File contains slash '%s'. Skipping" % title) | ||||||
|  |             else: | ||||||
|  |                 print("File not found '%s'" % title) | ||||||
|  |  | ||||||
|     def find_files(self,folders): |     def find_files(self,folders): | ||||||
|         for link in folders.find_all('a'): |         for link in folders.find_all('a'): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user