Update Scientific American

This commit is contained in:
Kovid Goyal 2019-03-01 09:05:29 +05:30
parent a2b16ded41
commit 09d40007b2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -55,8 +55,9 @@ class ScientificAmerican(BasicNewsRecipe):
root = self.index_to_soup(
'http://www.scientificamerican.com/sciammag/', as_tree=True)
select = Select(root)
url = [x.get('content', '') for x in select('html > head meta') if x.get('property',None) == "og:url"][0]
self.cover_url = [x.get('src', '') for x in select('main .product-detail__image picture img')][0]
url = [x.get('href', '') for x in select('main .store-listing__img a')][0]
url = absurl(url)
self.cover_url = [x.get('src', '') for x in select('main .store-listing__img img')][0]
# Now parse the actual issue to get the list of articles
select = Select(self.index_to_soup(url, as_tree=True))