diff --git a/fanficfare/adapters/adapter_fictionalleyorg.py b/fanficfare/adapters/adapter_fictionalleyorg.py index 488d099..7c91e0d 100644 --- a/fanficfare/adapters/adapter_fictionalleyorg.py +++ b/fanficfare/adapters/adapter_fictionalleyorg.py @@ -203,11 +203,14 @@ class FictionAlleyOrgSiteAdapter(BaseSiteAdapter): # Yes, it's an evil kludge, but what can ya do? Using # something other than div prevents soup from pairing # our div with poor html inside the story text. - data = data.replace('','').replace('','') + crazy = "crazytagstringnobodywouldstumbleonaccidently" + data = data.replace('','<'+crazy+' id="storytext">').replace('','') # problems with some stories confusing Soup. This is a nasty # hack, but it works. - data = data[data.index("')+len('')] soup = self.make_soup(data) body = soup.findAll('body') ## some stories use a nested body and body @@ -218,7 +221,7 @@ class FictionAlleyOrgSiteAdapter(BaseSiteAdapter): text = body[1] text.name='div' # force to be a div to avoid multiple body tags. else: - text = soup.find('crazytagstringnobodywouldstumbleonaccidently', {'id' : 'storytext'}) + text = soup.find(crazy, {'id' : 'storytext'}) text.name='div' # change to div tag. if not data or not text: diff --git a/fanficfare/adapters/base_adapter.py b/fanficfare/adapters/base_adapter.py index c09af43..5f97d3b 100644 --- a/fanficfare/adapters/base_adapter.py +++ b/fanficfare/adapters/base_adapter.py @@ -640,10 +640,21 @@ class BaseSiteAdapter(Configurable): Convenience method for getting a bs4 soup. Older and non-updated adapters call the included bs3 library themselves. ''' + + ## html5lib handles