This commit is contained in:
j 2014-05-09 12:20:55 +02:00
parent 73a60e73d7
commit 07cd885b0a

View file

@ -32,7 +32,9 @@ def get_data(isbn):
r[key] = '' r[key] = ''
if key == 'pages' and r[key]: if key == 'pages' and r[key]:
r[key] = int(r[key]) r[key] = int(r[key])
r['description'] = strip_tags(find_re(data, '<h2>Description:<\/h2>(.*?)<div ')).strip() desc = find_re(data, '<h2>Description:<\/h2>(.*?)<div ')
desc = desc.replace('<br /><br />', ' ').replace('<br /> ', ' ').replace('<br />', ' ')
r['description'] = strip_tags(desc).strip()
if r['description'] == u'Description of this item is not available at this time.': if r['description'] == u'Description of this item is not available at this time.':
r['description'] = '' r['description'] = ''
r['cover'] = find_re(data, '<img src="(.*?)" alt="Book cover').replace('._SL160_', '') r['cover'] = find_re(data, '<img src="(.*?)" alt="Book cover').replace('._SL160_', '')