Skip to content

Commit

Permalink
Fix spider: cuya_board_revision
Browse files Browse the repository at this point in the history
  • Loading branch information
SimmonsRitchie committed Jan 24, 2024
1 parent 87cb272 commit 181e146
Show file tree
Hide file tree
Showing 4 changed files with 996 additions and 590 deletions.
32 changes: 5 additions & 27 deletions city_scrapers/spiders/cuya_board_revision.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
import re

from city_scrapers_core.constants import BOARD
from city_scrapers_core.spiders import CityScrapersSpider

from city_scrapers.mixins import CuyaCountyMixin
from city_scrapers.mixins import CuyaCountyMixin2


class CuyaBoardRevisionSpider(CuyaCountyMixin, CityScrapersSpider):
class CuyaBoardRevisionSpider(CuyaCountyMixin2, CityScrapersSpider):
name = "cuya_board_revision"
agency = "Cuyahoga County Board of Revision"
start_urls = ["http://bc.cuyahogacounty.us/en-US/Board-of-Revision.aspx"]
start_urls = [
"https://cuyahogacounty.gov/boards-and-commissions/board-details/internal/board-of-revision" # noqa
]
classification = BOARD
location = {
"name": "County Headquarters, Room 2-101(G)",
"address": "2079 East 9th St Cleveland, OH 44115",
}

def _parse_title(self, response):
title_str = super()._parse_title(response)
return title_str.replace("BOR", "Board of Revision")

def _parse_location(self, response):
loc_str = super()._parse_location(response)
room_match = re.search(
r"(room|rm)\.? [a-z0-9\-\(\)]+", loc_str or "", flags=re.I
)
if not loc_str or "2-101" in loc_str or not room_match:
return self.location
room_str = room_match.group().strip()
# Add conference room info to location name
return {
**self.location,
"name": self.location["name"].replace("Room 2-101(G)", room_str),
}
Loading

0 comments on commit 181e146

Please sign in to comment.