Make ffnet/fpcom use BeautifulSoup (not Stone) for nested divs.

This commit is contained in:
Jim Miller 2011-06-07 14:19:25 -05:00
parent aa629c2c39
commit 2a353a74f9

View file

@ -199,11 +199,15 @@ class FanFictionNetSiteAdapter(BaseSiteAdapter):
## more if hit too fast. This is in
## additional to what ever the
## slow_down_sleep_time setting is.
soup = bs.BeautifulStoneSoup(self._fetchUrl(url),
selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags.
soup = bs.BeautifulSoup(self._fetchUrl(url),
selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags.
## Remove the 'share' button.
sharediv = soup.find('div', {'class' : 'a2a_kit a2a_default_style'})
sharediv.extract()
div = soup.find('div', {'id' : 'storytext'})
if None == div:
raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)