Skip to content

Commit

Permalink
MO: prevent xml parse error from killing scrape job
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Dec 5, 2024
1 parent 18ba34d commit bed0dc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scrapers/mo/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,11 @@ def _scrape_lower_chamber(self, session):
bill_id = f"{bill_type} {bill_num}"

bill_content = self.get(bill_url)
ib_response = lxml.etree.fromstring(bill_content.content)
try:
ib_response = lxml.etree.fromstring(bill_content.content)
except lxml.etree.XMLSyntaxError:
self.logger.error(f"Error parsing XML for bill {bill_num} at {bill_url}")
continue

yield from self.parse_house_bill(
ib_response, bill_id, bill_year, bill_code, session
Expand Down

0 comments on commit bed0dc3

Please sign in to comment.