fail better
This commit is contained in:
parent
7e37713c95
commit
5ecb2aeafc
3 changed files with 10 additions and 3 deletions
|
|
@ -19,7 +19,7 @@ def get_ids(key, value):
|
|||
ids = []
|
||||
if key == 'isbn':
|
||||
url = 'http://www.loc.gov/search/?q=%s&all=true' % value
|
||||
html = ox.cache.read_url(url).decode('utf-8')
|
||||
html = ox.cache.read_url(url).decode('utf-8', 'ignore')
|
||||
match = re.search('"http://lccn.loc.gov/(\d+)"', html)
|
||||
if match:
|
||||
ids.append(('lccn', match.group(1)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue