aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2014-12-29 14:48:56 +0100
committerPetter Reinholdtsen <pere@hungry.com>2014-12-29 14:48:56 +0100
commitccd8be8428a962f8a626213079babfaf2ec1c799 (patch)
treef4794358ab2cb1825bc8a997c9c29f303fc1a0e2
parent4155778edb20f9211ea4e262fd06a1ccad1fac08 (diff)
Do not crash on non-existing URLs.
-rw-r--r--scrapersources/postliste-halden4
1 files changed, 3 insertions, 1 deletions
diff --git a/scrapersources/postliste-halden b/scrapersources/postliste-halden
index 7cb0345..0fd6df2 100644
--- a/scrapersources/postliste-halden
+++ b/scrapersources/postliste-halden
@@ -44,6 +44,8 @@ def process_pdf(parser, pdfurl, errors):
errors.append(e)
except IndexError, e:
errors.append(e)
+ except urllib2.HTTPError, e:
+ errors.append(e)
def process_page_queue(parser, errors):
try:
@@ -98,4 +100,4 @@ process_page_queue(parser, errors)
process_journal_pdfs(parser, u"http://www.halden.kommune.no/selvbetjening/postliste/Sider/Inng%C3%A5ende-postlister.aspx", errors)
process_journal_pdfs(parser, u"http://www.halden.kommune.no/selvbetjening/postliste/Sider/Utg%C3%A5ende-postliste-.aspx", errors)
process_page_queue(parser, errors)
-report_errors(errors) \ No newline at end of file
+report_errors(errors)