Просмотр исходного кода

Suparate article content on newline

JoostSijm 4 лет назад
Родитель
Сommit
df31334552
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/rival_regions_wrapper/api_wrapper/article.py

+ 1 - 1
src/rival_regions_wrapper/api_wrapper/article.py

@@ -38,7 +38,7 @@ class Article():
             'author_id': int(author['action'].replace('slide/profile/', '')),
             'region_name': region.text,
             'region_id': int(region['action'].replace('map/details/', '')),
-            'content_text': news_content.text.strip(),
+            'content_text': news_content.get_text(separator="\n", strip=True),
             'content_html': news_content.prettify(),
             'rating': int(soup.select_one('#news_number').text),
             'comments': int(soup.select_one('.news_comments_link').text)