Make code compatible with older versions of BeautifulSoup and make locating last updated string more robust

This commit is contained in:
cryzed 2017-04-23 19:10:07 +02:00
parent e41bb51453
commit 54f2e43363

View file

@ -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