From 8bcf2e53dbe2329737cb48ea824c61ceef4eca13 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 2 Jan 2012 10:40:19 -0600 Subject: [PATCH] Fix siye.co.uk for stories with

instead of
. --- fanficdownloader/adapters/adapter_siyecouk.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fanficdownloader/adapters/adapter_siyecouk.py b/fanficdownloader/adapters/adapter_siyecouk.py index 8222b15..a7066a0 100644 --- a/fanficdownloader/adapters/adapter_siyecouk.py +++ b/fanficdownloader/adapters/adapter_siyecouk.py @@ -263,12 +263,16 @@ class SiyeCoUkAdapter(BaseSiteAdapter): # XXX logging.debug('Getting chapter text from: %s' % url) - soup = bs.BeautifulSoup(self._fetchUrl(url)) + # soup = bs.BeautifulSoup(self._fetchUrl(url)) + # BeautifulSoup objects to

inside , which + # technically isn't allowed. + soup = bs.BeautifulStoneSoup(self._fetchUrl(url), + selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags. - # not the most unique thing in the work, bit it appears to be - # the best we can do there. + # not the most unique thing in the world, but it appears to be + # the best we can do here. story = soup.find('span', {'style' : 'font-size: 100%;'}) - + if None == story: raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)