Skip to content

Commit

Permalink
NV: fix for 502 error (#5272)
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst authored Feb 4, 2025
1 parent 221c42b commit 32c3d3d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scrapers/nv/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from openstates.scrape import Scraper, Bill, VoteEvent
from .common import session_slugs
from spatula import HtmlListPage, HtmlPage, CSS, XPath, SelectorError
from scrapelib import HTTPError

TZ = pytz.timezone("PST8PDT")
ACTION_CLASSIFIERS = (
Expand Down Expand Up @@ -366,7 +367,13 @@ def process_page(self):
title, link, media_type="application/pdf", on_duplicate="ignore"
)
ex_url = self.source.url.replace("Text", "Exhibits")
return ExhibitTabText(bill, source=ex_url)

try:
return ExhibitTabText(bill, source=ex_url)
except HTTPError:
self.warning(f"Failure on exhibit url {ex_url}")
am_url = self.source.url.replace("Text", "Amendments")
return AmendmentTabText(bill, source=am_url)


class ExhibitTabText(HtmlPage):
Expand Down

0 comments on commit 32c3d3d

Please sign in to comment.