can use okc with monboob

This commit is contained in:
Romain Bignon 2014-05-17 19:05:58 +02:00
commit db2494d3ad
3 changed files with 38 additions and 54 deletions

View file

@ -43,6 +43,7 @@ class ThreadPage(BasePage):
threads.append({
u'username' : unicode(elem.getchildren()[0].get('href').split('/')[-1].split('?')[0]),
u'id' : unicode(elem.get('id', '').split('_')[1]),
u'date' : unicode(elem.find('.//p[@class="date"]').text)
})
return threads
@ -57,7 +58,10 @@ class MessagesPage(BasePage):
'messages' : [],
}
mails['member']['pseudo'] = self.document.xpath('//li[starts-with(@id, "usr_")]')[0].attrib['id'].split('_', 1)[-1]
try:
mails['member']['pseudo'] = self.document.xpath('//li[starts-with(@id, "usr_")]')[0].attrib['id'].split('_', 1)[-1]
except IndexError:
mails['member']['pseudo'] = 'Unknown'
for li_msg in reversed(ul_item.getchildren()):
div = li_msg.getchildren()[1]