Implement logging and adjusted database location

Changes include creating the directory and database before the script.
This commit is contained in:
雲華
2021-08-17 19:36:26 -04:00
parent 12bd0027f9
commit aaea16ab99
3 changed files with 8 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ class NewsScraper:
raise Exception()
self.client = client if None else ClientSession(loop=loop)
self.database = _create_connection('news.db') if database is None else database
self.database = _create_connection('database/news.db') if database is None else database
self._md5 = hashlib.new('md5', usedforsecurity=False)
async def _fetch_url(self, url):