Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/icoz/habraparse.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkvakanet <kvakanet@users.noreply.github.com>2017-07-25 20:41:57 +0300
committerGitHub <noreply@github.com>2017-07-25 20:41:57 +0300
commit6154b6614fb79f2f84fa4c71c34bd3f291c662a8 (patch)
tree78d3da3efac32970575aa9654d46b5f69a26d68f
parent9e213aa09f1dcdb747d350d5af8ca3cbfbe66bcc (diff)
New markup habr and geektimes
На Хабре и Гиктаймс поменялись классы для контента. Изменение скорее всего было 1 мая.
-rw-r--r--habr/topic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/habr/topic.py b/habr/topic.py
index a098f2c..c12332f 100644
--- a/habr/topic.py
+++ b/habr/topic.py
@@ -81,8 +81,8 @@ class TMTopic(object):
tmp = doc.xpath(
"//ul[@class='postinfo-panel postinfo-panel_post']//span[@class='oting-wjt__counter-score js-score']")
self.post['rating'] = tmp[0].text if len(tmp) else ''
- tmp = doc.xpath("//div[@class='content html_format']") or \
- doc.xpath('//div[@class="article__body"]')
+ tmp = doc.xpath("//div[@class='content html_format js-mediator-article']") or \
+ doc.xpath('//div[@class="article__body js-mediator-article"]')
self.post['text'] = etree.tostring(tmp[0], pretty_print=True, method='html').decode('utf-8') \
if len(tmp) else ''
self.post['comments'] = []