Skip to content

Commit

Permalink
Merge pull request #5008 from braykuka/nv-add-emptyscrape-to-event-sc…
Browse files Browse the repository at this point in the history
…raper

NV: Add EmptyScrape to Event Scraper
  • Loading branch information
NewAgeAirbender authored Aug 14, 2024
2 parents c759df0 + 10b9312 commit fa0519b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scrapers/nv/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from utils import LXMLMixin
from utils.media import get_media_type
from openstates.scrape import Scraper, Event
from openstates.exceptions import EmptyScrape
from spatula import HtmlPage, PdfPage, URL, XPath, SelectorError
import re

Expand Down Expand Up @@ -96,7 +97,7 @@ def process_page(self):
meetings.append(cur_row)
# Reset cur_row so leftover elements don't get mixed in with next set of divs
cur_row = []

event_count = 0
for i in meetings:
# First element contains: the title and date
title = XPath(".//h3/a[1]/text()").match_one(i[0])
Expand Down Expand Up @@ -210,6 +211,9 @@ def process_page(self):
event.add_bill(bill)

yield event
event_count += 1
if event_count < 1:
raise EmptyScrape


class NVEventScraper(Scraper, LXMLMixin):
Expand Down

0 comments on commit fa0519b

Please sign in to comment.