Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spider: cuya_audit #81

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 5 additions & 19 deletions city_scrapers/spiders/cuya_audit.py
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}
Loading
Loading