fix chi_policeboard
@@ -4,6 +4,7 @@ from datetime import datetime
from city_scrapers_core.constants import BOARD
from city_scrapers_core.items import Meeting
from city_scrapers_core.spiders import CityScrapersSpider
+from scrapy import Selector
class ChiPoliceBoardSpider(CityScrapersSpider):
@@ -23,7 +24,9 @@ class ChiPoliceBoardSpider(CityScrapersSpider):
location = self._parse_location(response)
start_time = self._parse_start_time(response)
- for item in response.xpath('//p[contains(@style,"padding-left")]'):
+ for row in response.xpath('//p[contains(@style,"padding-left")]').extract():
+ for block in row.split("<br>"):
+ item = Selector(text=block)
start_date = self._parse_start_date(item, year)
if not start_date:
continue
@@ -44,7 +47,7 @@ class ChiPoliceBoardSpider(CityScrapersSpider):
yield meeting
def _parse_links(self, item, response):
- anchors = item.xpath("a")
+ anchors = item.css("a")
return [
{
"href": response.urljoin(link.xpath("@href").extract_first("")),
