|
@@ -1,6 +1,7 @@
|
|
|
import requests
|
|
|
from bs4 import BeautifulSoup
|
|
|
from isbnlib.dev import stdmeta
|
|
|
+from isbnlib.dev._exceptions import NoDataForSelectorError
|
|
|
|
|
|
class Book:
|
|
|
LANGUAGE_MAP = {"Engels": "en", "Nederlands": "nl", "Duits": "de"}
|
|
@@ -73,7 +74,6 @@ ISBN: {self.isbn}"""
|
|
|
soup = BeautifulSoup(r.text, 'html.parser')
|
|
|
return Book(isbn, soup)
|
|
|
else:
|
|
|
- print("Book not found")
|
|
|
return None
|
|
|
|
|
|
|
|
@@ -81,3 +81,5 @@ def query(isbn):
|
|
|
book = Book.find(isbn)
|
|
|
if book:
|
|
|
return book.as_record()
|
|
|
+ else:
|
|
|
+ raise NoDataForSelectorError(isbn)
|