adapter_mcstoriescom Allow multiple authors. Closes #847

This commit is contained in:
Jim Miller 2022-06-05 14:06:29 -05:00
parent b5dd8d4565
commit e3b487205d

View file

@ -93,12 +93,13 @@ class MCStoriesComSiteAdapter(BaseSiteAdapter):
self.story.setMetadata('title', title.text)
# Author
author = soup1.find('h3', class_='byline').a
authorurl = urlparse.urljoin(self.url, author['href'])
self.story.setMetadata('author', author.text)
self.story.setMetadata('authorUrl', authorurl)
authorid = os.path.splitext(os.path.basename(authorurl))[0]
self.story.setMetadata('authorId', authorid)
# byline = soup1.find('h3', class_='byline')
for author in soup1.select('h3.byline a'):
authorurl = urlparse.urljoin(self.url, author['href'])
self.story.addToList('author', author.text)
self.story.addToList('authorUrl', authorurl)
authorid = os.path.splitext(os.path.basename(authorurl))[0]
self.story.addToList('authorId', authorid)
# Description
synopsis = soup1.find('section', class_='synopsis')