Commit ea4d4360 authored by Kiste's avatar Kiste
Browse files

Catch error

parent c47a8c8a
......@@ -7,6 +7,7 @@ published by Sam Hocevar. See for more details.
import json
import urllib.error
import urllib.parse
import urllib.request
......@@ -89,7 +90,11 @@ def do_feed(url, rules_path, verbose):
url = "{0.scheme}://{0.netloc}/".format(urllib.parse.urlsplit(link))
if verbose:
print('>Rule match!')
soup = BeautifulSoup(urllib.request.urlopen(link), 'lxml')
soup = BeautifulSoup(urllib.request.urlopen(link), 'lxml')
except urllib.error.HTTPError:
fe.content('Error fetching content!')
comments = None
if 'comments' in url_rules:
comments =['comments'])
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