From 54f2e43363ed2c7eb4385bc4e2618a0c2b51a62c Mon Sep 17 00:00:00 2001 From: cryzed Date: Sun, 23 Apr 2017 19:10:07 +0200 Subject: [PATCH] Make code compatible with older versions of BeautifulSoup and make locating last updated string more robust --- fanficfare/adapters/adapter_webnovelcom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fanficfare/adapters/adapter_webnovelcom.py b/fanficfare/adapters/adapter_webnovelcom.py index acd032cf..deb53309 100644 --- a/fanficfare/adapters/adapter_webnovelcom.py +++ b/fanficfare/adapters/adapter_webnovelcom.py @@ -162,7 +162,9 @@ class WWWWebNovelComAdapter(BaseSiteAdapter): synopsis = soup.find('div', {'class': 'det-abt'}).find('p') self.setDescription(url, synopsis) - last_updated_string = soup.select_one('.ml10').string + # First finding .lst-chapter (which is an unique class on the site), and then navigating to the last update date + # should be the most robust way of finding the last updated string + last_updated_string = soup.find(attrs={'class': 'lst-chapter'}).find_next_sibling('small').string last_updated = _parse_relative_date_string(last_updated_string) # Published date is always unknown, so simply don't set it