fix relevance of news/diaries
This commit is contained in:
parent
31d1e30584
commit
cedf1f7970
1 changed files with 4 additions and 4 deletions
|
|
@ -127,10 +127,10 @@ class Article(Content):
|
||||||
self.date = local2utc(self.date)
|
self.date = local2utc(self.date)
|
||||||
except BrokenPageError:
|
except BrokenPageError:
|
||||||
pass
|
pass
|
||||||
forms = self.browser.parser.select(tree.find('footer'), 'form.button_to')
|
for form in self.browser.parser.select(tree.find('footer'), 'form.button_to'):
|
||||||
if len(forms) > 0:
|
if form.attrib['action'].endswith('/for'):
|
||||||
self.relevance_url = forms[0].attrib['action'].rstrip('for').rstrip('against')
|
self.relevance_url = form.attrib['action'].rstrip('for').rstrip('against')
|
||||||
self.relevance_token = self.browser.parser.select(forms[0], 'input[name=authenticity_token]', 1).attrib['value']
|
self.relevance_token = self.browser.parser.select(form, 'input[name=authenticity_token]', 1).attrib['value']
|
||||||
|
|
||||||
self.score = int(self.browser.parser.select(tree, 'div.figures figure.score', 1).text)
|
self.score = int(self.browser.parser.select(tree, 'div.figures figure.score', 1).text)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue