support wiki and forums

This commit is contained in:
Romain Bignon 2011-03-19 09:27:42 +01:00
commit 4a864a97af
3 changed files with 25 additions and 12 deletions

View file

@ -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')