Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Apr 17, 2013
2 parents caf937d + e81e0f0 commit 5113785
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openstates/me/legislators.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ def scrape_reps(self, chamber, term_name):
# Try to get color photo from the dems' website.
elif party == 'Democratic':
xpath = '//a[contains(@href, "housedems")]/@href'
party_website_url = doc.xpath(xpath)[0]

els = doc.xpath(xpath)
if els:
party_website_url = els[0]

try:
party_website_html = self.urlopen(party_website_url)
except scrapelib.HTTPError:
Expand Down

0 comments on commit 5113785

Please sign in to comment.