Skip to content

Commit

Permalink
DE: Modified to handle exceptions from LXML utility function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Lo committed May 12, 2016
1 parent adc5ac1 commit f91ec20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions openstates/de/bills.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
import re
import lxml.html
import scrapelib
import requests
import actions
from billy.scrape import ScrapeError
from billy.scrape.bills import BillScraper, Bill
Expand Down Expand Up @@ -45,8 +45,8 @@ def scrape_bill(self,link,chamber,session):
base_url = "http://legis.delaware.gov"
text_base_url = "http://legis.delaware.gov/LIS/lis{session}.nsf/vwLegislation/{bill_id}/$file/legis.html?open"
try:
page = self.lxmlize(link)
except scrapelib.HTTPError:
page = self.lxmlize(link, True)
except requests.exceptions.HTTPError:
self.logger.warning('404. Apparently the bill hasn\'t been posted')
return
nominee = self.get_node(page, './/div[@id="page_header"]/text()')
Expand Down Expand Up @@ -247,7 +247,7 @@ def scrape_bill(self,link,chamber,session):
vote_chamber = "lower" if "house" in name.lower() else "upper"
try:
self.head(doc)
except scrapelib.HTTPError:
except requests.exceptions.HTTPError:
self.logger.warning("could not access vote document")
continue
vote_page = self.lxmlize(doc)
Expand Down

0 comments on commit f91ec20

Please sign in to comment.