diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2014-01-27 14:50:43 +0200 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2014-01-27 14:50:43 +0200 |
| commit | aed99a6272023d99e2cdea5a19a5922214c25661 (patch) | |
| tree | 8af47497820500f8714f4f565937a60278503c9e | |
| parent | 883ef467898355edb0fa60642d40bbef3abe2c95 (diff) | |
Filter blank lins on ynet
| -rw-r--r-- | newsdiff/core/parsers/ynet.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newsdiff/core/parsers/ynet.py b/newsdiff/core/parsers/ynet.py index 767594e..769d238 100644 --- a/newsdiff/core/parsers/ynet.py +++ b/newsdiff/core/parsers/ynet.py @@ -33,7 +33,7 @@ class YnetParser(HtmlSoupParser): time = re.findall(r'\d\d:\d\d', author_bar.text)[0] article_date = self.TIMEZONE.localize(datetime.strptime(' '.join([date, time]), '%d.%m.%y %H:%M')) article_body = soup.find('div', class_='art_body').find_all('p') - article_text = '\n'.join([p.text.strip().encode('iso-8859-1') for p in article_body]) + article_text = '\n'.join([p.text.strip().encode('iso-8859-1') for p in article_body if p.text]) with transaction.atomic(), reversion.create_revision(): try: |
