*trying* to resolve style issues :)
@@ -4,11 +4,10 @@ All spiders should yield data shaped according to the Open Civic Data
specification (http://docs.opencivicdata.org/en/latest/data/event.html).
"""
import scrapy
-
import json
import datetime as dt
import pytz
-# import requests
+
class CclbaSpider(scrapy.Spider):
"""
@@ -64,7 +63,6 @@ class CclbaSpider(scrapy.Spider):
'current_year': str(date.year),
'event_count':'0',
'fc_focus_day': str(date.day),
-
'filters[0][filter_type]':'tax',
'filters[0][filter_name]':'event_type',
'filters[0][filter_val]':'9, 16, 17, 18, 19, 20, 26, 27',
@@ -93,9 +91,7 @@ class CclbaSpider(scrapy.Spider):
)
def parse(self, response):
-
# import pdb; pdb.set_trace()
-
data = json.loads(response.text)
item = scrapy.Selector(text=data['content'], type="html")
@@ -163,7 +159,6 @@ class CclbaSpider(scrapy.Spider):
status = 'passed'
else:
status = 'tentative'
-
return status
def _parse_street_address(self, item):
@@ -176,9 +171,7 @@ class CclbaSpider(scrapy.Spider):
optional and may be more trouble than they're worth to collect.
"""
street_address = self._parse_street_address(item)
-
location_detail = item.css('span[class=\'evcal_desc evo_info \']::attr(data-location_name)').extract_first()
-
return {
'url': 'http://www.cookcountylandbank.org/',
'name': location_detail + ", " + street_address,
@@ -210,7 +203,6 @@ class CclbaSpider(scrapy.Spider):
start_date_time = dt.datetime.strptime(start_date + ' ' + start_time, '%Y-%m-%d %I:%M %p')
start_date_time = pytz.timezone('US/Central').localize(start_date_time)
start_date_time = start_date_time.astimezone(pytz.utc).isoformat()
-
return start_date_time
def _parse_end(self, item):
@@ -219,7 +211,6 @@ class CclbaSpider(scrapy.Spider):
Left commented the code to pull the end date if you want to include later.
"""
# end_date = item.css('[itemprop=\'endDate\']')[0].get('datetime')
-
return None
"""
@@ -227,7 +218,6 @@ class CclbaSpider(scrapy.Spider):
The source_url goes straight to all the info and also includes an embedded
PDF that could potentially be scraped. Didn't bother with that here.
"""
-
# def _parse_agenda(self, item):
# agenda = []
# for item in item.css('div[class=\'eventon_desc_in\'] h4'):
@@ -238,7 +228,6 @@ class CclbaSpider(scrapy.Spider):
# agenda.append(description)
# else:
# continue
-
# return agenda
def _parse_sources(self, item):
