From 69ecfb083773ae2d2f1e85c8fe9c03f705570ba6 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 22 Jul 2019 16:45:45 -0500 Subject: [PATCH] XF posts can include a tags without href, look for href searching for links. Closes #417 --- fanficfare/adapters/base_xenforoforum_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fanficfare/adapters/base_xenforoforum_adapter.py b/fanficfare/adapters/base_xenforoforum_adapter.py index 247c9f57..3591f30e 100644 --- a/fanficfare/adapters/base_xenforoforum_adapter.py +++ b/fanficfare/adapters/base_xenforoforum_adapter.py @@ -507,7 +507,7 @@ class BaseXenForoForumAdapter(BaseSiteAdapter): if self.num_chapters() < 1: self.add_chapter(first_post_title,useurl) # logger.debug(index_post) - for (url,name,tag) in [ (x['href'],stripHTML(x),x) for x in index_post.find_all('a') ]: + for (url,name,tag) in [ (x['href'],stripHTML(x),x) for x in index_post.find_all('a',href=True) ]: (is_chapter_url,url) = self._is_normalize_chapterurl(url) # skip quote links as indicated by up arrow character or data-xf-click=attribution if is_chapter_url and name != u"\u2191" and tag.get("data-xf-click",None)!="attribution":