Commit 3fc391e0 authored by Kiste's avatar Kiste
Browse files

Fix broken articles

parent 78bdb937
......@@ -100,6 +100,9 @@ def do_feed(url, rules_path, verbose):
if 'comments' in url_rules:
comments = soup.select(url_rules['comments'])
soup = do_soup(soup, url_rules, url, verbose)
if not soup:
fe.content('Error doing the soup!')
continue
if comments:
for e in comments:
soup.append(e)
......@@ -118,7 +121,10 @@ def do_feed(url, rules_path, verbose):
def do_soup(soup, rules, url, verbose):
new_soup = soup.select(rules['article'])
new_soup = new_soup[0]
try:
new_soup = new_soup[0]
except IndexError:
return None
if 'next' in rules:
for page in new_soup.select(rules['next']):
if verbose:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment