From 52fc8633e5ccb65b2e63b9150a58a931974b5e98 Mon Sep 17 00:00:00 2001 From: ia6eia Date: Sat, 4 Feb 2012 21:14:48 +0000 Subject: [PATCH] Fixed the problem of story footnotes being confused with chapter footnotes. --- .../adapters/adapter_archiveofourownorg.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fanficdownloader/adapters/adapter_archiveofourownorg.py b/fanficdownloader/adapters/adapter_archiveofourownorg.py index 0484211..05e4d26 100644 --- a/fanficdownloader/adapters/adapter_archiveofourownorg.py +++ b/fanficdownloader/adapters/adapter_archiveofourownorg.py @@ -242,21 +242,20 @@ class ArchiveOfOurOwnOrgAdapter(BaseSiteAdapter): if chapnotes != None: chapter.append(bs.BeautifulSoup("Notes for the Chapter:")) chapter.append(chapnotes) - - footnotes = soup.find('div', {'id' : "work_endnotes"}) - chapfoot = soup.find('div', {'class' : "end notes module"}) - soup = soup.find('div', {'class' : "userstuff module"}) - chtext = soup.find('h3', {'class' : "landmark heading"}) + text = soup.find('div', {'class' : "userstuff module"}) + chtext = text.find('h3', {'class' : "landmark heading"}) if chtext: chtext.extract() - chapter.append(soup) + chapter.append(text) + chapfoot = soup.find('div', {'class' : "end notes module", 'role' : "complementary"}) if chapfoot != None: chapfoot = chapfoot.find('blockquote') chapter.append(bs.BeautifulSoup("Notes for the Chapter:")) chapter.append(chapfoot) + footnotes = soup.find('div', {'id' : "work_endnotes"}) if footnotes != None: footnotes = footnotes.find('blockquote') chapter.append(bs.BeautifulSoup("Author's Note:"))