-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87cb272
commit 181e146
Showing
4 changed files
with
996 additions
and
590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
} |
Oops, something went wrong.