Update Associated Press

This commit is contained in:
Kovid Goyal 2017-07-31 19:48:16 +05:30
parent 8cc5499d91
commit 790b8273a7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -35,6 +35,8 @@ class AssociatedPress(BasicNewsRecipe):
articles = []
for x in soup.findAll('p', attrs={'class': ['ap-newsbriefitem-p', 'ap-topheadlineitem-p']}):
if not x.contents:
x = x.parent
a = x.find('a', href=True)
title = self.tag_to_string(a)
url = "http://hosted.ap.org" + a['href']