author is not none closes #511
This commit is contained in:
parent
3f9cfc1029
commit
61dcd8dd02
1 changed files with 3 additions and 2 deletions
|
|
@ -21,13 +21,14 @@ class NoAuthorElement(SelectElementException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class Article(object):
|
class Article(object):
|
||||||
|
author = u''
|
||||||
|
|
||||||
def __init__(self, browser, _id):
|
def __init__(self, browser, _id):
|
||||||
self.browser = browser
|
self.browser = browser
|
||||||
self.id = _id
|
self.id = _id
|
||||||
self.title = u''
|
self.title = u''
|
||||||
self.body = u''
|
self.body = u''
|
||||||
self.url = u''
|
self.url = u''
|
||||||
self.author = u''
|
|
||||||
self.date = None
|
self.date = None
|
||||||
|
|
||||||
class GenericNewsPage(BasePage):
|
class GenericNewsPage(BasePage):
|
||||||
|
|
@ -45,7 +46,7 @@ class GenericNewsPage(BasePage):
|
||||||
try:
|
try:
|
||||||
return self.get_element_author().text_content().strip()
|
return self.get_element_author().text_content().strip()
|
||||||
except NoAuthorElement:
|
except NoAuthorElement:
|
||||||
return None
|
return self.__article.author
|
||||||
|
|
||||||
def get_title(self):
|
def get_title(self):
|
||||||
return select(
|
return select(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue