support wiki and forums
This commit is contained in:
parent
e5d40200a7
commit
4a864a97af
3 changed files with 25 additions and 12 deletions
|
|
@ -119,9 +119,12 @@ class Article(Content):
|
|||
self.author = unicode(a.text)
|
||||
self.username = unicode(a.attrib['href'].split('/')[2])
|
||||
self.body = self.browser.parser.tostring(select(tree, 'div.content', 1))
|
||||
self.date = datetime.strptime(select(header, 'time', 1).attrib['datetime'].split('+')[0],
|
||||
'%Y-%m-%dT%H:%M:%S')
|
||||
self.date = local2utc(self.date)
|
||||
try:
|
||||
self.date = datetime.strptime(select(header, 'time', 1).attrib['datetime'].split('+')[0],
|
||||
'%Y-%m-%dT%H:%M:%S')
|
||||
self.date = local2utc(self.date)
|
||||
except SelectElementException:
|
||||
pass
|
||||
forms = select(tree.find('footer'), 'form.button_to')
|
||||
if len(forms) > 0:
|
||||
self.relevance_url = forms[0].attrib['action'].rstrip('for').rstrip('against')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue