Skip to content

Commit

Permalink
manage exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cirotix committed Dec 3, 2014
1 parent 2d37844 commit 8b19d62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scraper.py
Expand Up @@ -89,7 +89,10 @@ def get_country_index():
doc = html.parse(urlopen(req))
anchors = list(doc.findall('//table[@id="searchResultsTable"]/tbody//a'))
for a in anchors:
get_entry(urljoin(URL, a.get('href')))
try:
get_entry(urljoin(URL, a.get('href')))
except:
continue
if doc.find('//span[@class="pagelinks"]/a/img[@alt="Next"]') is None:
break

Expand Down

0 comments on commit 8b19d62

Please sign in to comment.