This commit is contained in:
j 2014-05-26 00:23:48 +02:00
commit 5e606b21d8
2 changed files with 8 additions and 6 deletions

View file

@ -47,11 +47,13 @@ def lookup(id):
key = e.attrib['id'].replace('bibtip_', '')
value = e.text_content()
data[key] = value
info = doc.xpath('//textarea[@id="util-em-note"]')[0].text
info = dict([i.split(':', 1) for i in info.split('\n\n')[1].split('\n')])
for key in info:
k = key.lower()
data[k] = info[key].strip()
info = doc.xpath('//textarea[@id="util-em-note"]')
if info:
info = info[0].text
info = dict([i.split(':', 1) for i in info.split('\n\n')[1].split('\n')])
for key in info:
k = key.lower()
data[k] = info[key].strip()
for key in ('id', 'instance', 'mediatype', 'reclist', 'shorttitle'):
if key in data:
del data[key]