-
-
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 #78 from City-Bureau/fix-cuya-workforce-dev
🕷️ Fix spider: cuya_workforce_development
- Loading branch information
Showing
5 changed files
with
1,284 additions
and
767 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,39 +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 CuyaWorkforceDevelopmentSpider(CuyaCountyMixin, CityScrapersSpider): | ||
class CuyaWorkforceDevelopmentSpider(CuyaCountyMixin2, CityScrapersSpider): | ||
name = "cuya_workforce_development" | ||
agency = "Cleveland/Cuyahoga County Workforce Development Board" | ||
start_urls = ["http://bc.cuyahogacounty.us/en-US/Workforce-Development.aspx"] | ||
start_urls = [ | ||
"https://cuyahogacounty.gov/boards-and-commissions/board-details/external/cleveland-cuyahoga-county-workforce-development-board" # noqa | ||
] | ||
classification = BOARD | ||
|
||
def _parse_title(self, response): | ||
title_parts = ( | ||
response.css("#contentColumn h1::text") | ||
.extract_first() | ||
.strip() | ||
.split("Development ") | ||
) | ||
return title_parts[-1].strip() | ||
|
||
def _parse_description(self, response): | ||
return re.sub( | ||
r"\s+", | ||
" ", | ||
" ".join( | ||
response.css("#contentColumn .padding > div > p *::text").extract() | ||
), | ||
).strip() | ||
|
||
def _parse_location(self, response): | ||
address = super()._parse_location(response) | ||
if address: | ||
address = address.replace(", Ohio", ", OH") | ||
else: | ||
address = "" | ||
return {"name": "", "address": address} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.