Skip to content

Commit

Permalink
Merge pull request #78 from City-Bureau/fix-cuya-workforce-dev
Browse files Browse the repository at this point in the history
🕷️ Fix spider: cuya_workforce_development
  • Loading branch information
SimmonsRitchie authored Jan 24, 2024
2 parents 87cb272 + f168913 commit 2843bac
Show file tree
Hide file tree
Showing 5 changed files with 1,284 additions and 767 deletions.
2 changes: 0 additions & 2 deletions c.csv

This file was deleted.

36 changes: 5 additions & 31 deletions city_scrapers/spiders/cuya_workforce_development.py
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}
1,377 changes: 889 additions & 488 deletions tests/files/cuya_workforce_development.html

Large diffs are not rendered by default.

Loading

0 comments on commit 2843bac

Please sign in to comment.