Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
**Tech scraper:**
scraper.py
- Add try except when calling method get_part_num in class Scraper
  • Loading branch information
Crinibus committed Nov 27, 2020
1 parent 0ed62e3 commit 712adb5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tech_scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ def __init__(self, category: str, URL: str):

self.name = Format.change_æøå(Format.change_name(self.name))
self.date = str(datetime.today().strftime('%Y-%m-%d'))
self.get_part_num()

try:
self.get_part_num()
except Exception as err:
self.logger.error(
f'Failed in method "{self.__class__.__name__}.get_part_num()": {err}',
exc_info=True
)

self.shorten_url()
self.check_part_num()

Expand Down

0 comments on commit 712adb5

Please sign in to comment.