Fix for newer BS4/soupsieve enforcing CSS selector rules about :/ chars.

This commit is contained in:
Jim Miller 2019-05-29 11:23:15 -05:00
parent 3b3e951100
commit a4127aee18

View file

@ -132,10 +132,12 @@ class FictionHuntComSiteAdapter(BaseSiteAdapter):
## find story url, might need to spin through author's pages.
while authpagea and not authstorya:
# logger.debug(authpagea)
logger.debug(authpagea)
authsoup = self.make_soup(self._fetchUrl(authpagea['href']))
authpagea = authsoup.find('a',{'class':'page-link','rel':'next'})
authstorya = authsoup.select('h4.Story__item-title a[href=%s]'%self.url)
# CSS selectors don't allow : or / unquoted, which
# BS4(and dependencies) didn't used to enforce.
authstorya = authsoup.select('h4.Story__item-title a[href="%s"]'%self.url)
if not authstorya:
raise exceptions.FailedToDownload("Error finding %s on author page(s)" % self.url)