GA fails on some chapters. Soup seems to work better than Stone this time.

This commit is contained in:
Jim Miller 2012-02-28 14:27:32 -06:00
parent 27ec7228ae
commit dd293909c0
2 changed files with 4 additions and 3 deletions

View file

@ -27,7 +27,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase):
description = 'UI plugin to download FanFiction stories from various sites.'
supported_platforms = ['windows', 'osx', 'linux']
author = 'Jim Miller'
version = (1, 5, 0)
version = (1, 5, 2)
minimum_calibre_version = (0, 8, 30)
#: This field defines the GUI plugin class that contains all the code

View file

@ -193,8 +193,9 @@ class GayAuthorsAdapter(BaseSiteAdapter):
logging.debug('Getting chapter text from: %s' % url)
soup = bs.BeautifulStoneSoup(self._fetchUrl(url),
selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags.
data = self._fetchUrl(url)
data = data[data.index("<div id='chapter-content'>"):]
soup = bs.BeautifulSoup(data) # this one's happier with Soup, not StoneSoup for some reason.
div = soup.find('div', {'id' : 'chapter-content'})