-
-
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.
Merge pull request #81 from haileyhoyat/cuya_audit
Fix spider: cuya_audit
- Loading branch information
Showing
4 changed files
with
1,083 additions
and
584 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,27 +1,13 @@ | ||
import re | ||
|
||
from city_scrapers_core.constants import ADVISORY_COMMITTEE | ||
from city_scrapers_core.spiders import CityScrapersSpider | ||
|
||
from city_scrapers.mixins import CuyaCountyMixin | ||
from city_scrapers.mixins import CuyaCountyMixin2 | ||
|
||
|
||
class CuyaAuditSpider(CuyaCountyMixin, CityScrapersSpider): | ||
class CuyaAuditSpider(CuyaCountyMixin2, CityScrapersSpider): | ||
name = "cuya_audit" | ||
agency = "Cuyahoga County Audit Committee" | ||
start_urls = ["http://bc.cuyahogacounty.us/en-US/Audit-Committee.aspx"] | ||
start_urls = [ | ||
"https://cuyahogacounty.gov/boards-and-commissions/board-details/external/audit-committee" # noqa | ||
] | ||
classification = ADVISORY_COMMITTEE | ||
location = { | ||
"name": "County Headquarters, 4-407 Conference Room B", | ||
"address": "2079 East 9th St Cleveland, OH 44115", | ||
} | ||
|
||
def _parse_location(self, response): | ||
detail_strs = response.css("blockquote dd::text").extract() | ||
loc_str = None | ||
for detail_str in detail_strs: | ||
if re.search(r"\d{3}", detail_str): | ||
loc_str = re.sub(r"\s+", " ", detail_str).strip() | ||
if not loc_str or "2079" in loc_str: | ||
return self.location | ||
return {"name": "", "address": loc_str} |
Oops, something went wrong.