extract annotations: return anchor to annotation, not the word in text
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 16 Sep 2011 07:58:20 +0000 (09:58 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 16 Sep 2011 07:58:35 +0000 (09:58 +0200)
librarian/html.py

index 9869513..5974d93 100644 (file)
@@ -271,7 +271,7 @@ def extract_annotations(html_path):
     footnotes = tree.find('//*[@id="footnotes"]')
     if footnotes is not None:
         for footnote in footnotes.findall('div'):
-            anchor = footnote.find('a[@href]').get('href')
+            anchor = footnote.find('a[@name]').get('name')
             del footnote[:2]
             text_str = etree.tostring(footnote, method='text', encoding='utf-8').strip()
             html_str = etree.tostring(footnote, method='html', encoding='utf-8')