Get newspaper source in author field
This commit is contained in:
parent
4f10915546
commit
52db84191b
1 changed files with 10 additions and 0 deletions
|
|
@ -44,6 +44,16 @@ class PresseuropPage(GenericNewsPage):
|
|||
title = title.split('|')[0]
|
||||
return title
|
||||
|
||||
def get_author(self):
|
||||
author = GenericNewsPage.get_author(self)
|
||||
try:
|
||||
source = self.document.getroot().xpath(
|
||||
"//span[@class='sourceinfo']/a")[0]
|
||||
source = source.text
|
||||
author = author + " | " + source
|
||||
return author
|
||||
except:
|
||||
return author
|
||||
|
||||
class DailyTitlesPage(PresseuropPage):
|
||||
def on_loaded(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue