diff --git a/fanficdownloader/adapters/adapter_portkeyorg.py b/fanficdownloader/adapters/adapter_portkeyorg.py index a03f0929..b13381b6 100644 --- a/fanficdownloader/adapters/adapter_portkeyorg.py +++ b/fanficdownloader/adapters/adapter_portkeyorg.py @@ -253,12 +253,15 @@ class PortkeyOrgAdapter(BaseSiteAdapter): # XXX def getChapterText(self, url): logging.debug('Getting chapter text from: %s' % url) - - soup = bs.BeautifulStoneSoup(self._fetchUrl(url), + data = self._fetchUrl(url) + soup = bs.BeautifulStoneSoup(data, selfClosingTags=('br','hr')) # otherwise soup eats the br/hr tags. #print("soup:%s"%soup) tag = soup.find('td', {'class' : 'story'}) + if tag == None and "
Chapter does not exist!
" in data: + print("Chapter is missing at: %s"%url) + return self.utf8FromSoup(url,bs.BeautifulStoneSoup("

Chapter does not exist!

Chapter is missing at: %s

"%(url,url))) tag.name='div' # force to be a div to avoid problems with nook. centers = tag.findAll('center')