In [30]:
# Import dependencies
import pandas
import mechanize
import re
from bs4 import BeautifulSoup
from dateutil import rrule
from datetime import datetime, timedelta
In [35]:
# CONFIGURATION
# Date range for search.
# This program scrapes results month-by-month
from_date = datetime(1990,01,01)
to_date = datetime.today()
In [32]:
# HELPERS
deficiency_row_details_re = re.compile('Item No.:\s*(?P<item_number>\d{2})\s*Site:\s*(?P<site>.*)\s*Violation:\s*(?P<violation>.*)\s*Recommendation:\s*(?P<recommendation>.*)')
deficiency_summary_info_re = re.compile('Cruise Ship:\s*(?P<cruise_ship>.*)\s*Cruise Line:\s*(?P<cruise_line>.*)\s*Inspection Date:\s*(?P<date>.*)\s*Inspection Score:\s*(?P<score>.*)')
def row_values_to_dictionary(row_values):
dictionary = {}
dictionary['cruise_ship'] = row_values[0].get_text().strip(' \t\n\r')
dictionary['cruise_line'] = row_values[1].get_text().strip(' \t\n\r')
dictionary['date'] = row_values[2].get_text().strip(' \t\n\r')
dictionary['score'] = row_values[3].get_text().strip(' \t\n\r')
# dictionary['report_url'] = row_values[5].find('a')['href']
return dictionary
def soup_to_list_of_dictionaries(soup):
data_to_return = {'summaries':[], 'deficiencies':[]}
table = soup.find('table',id='ctl00_ContentPlaceHolder1_dgMasterList')
table_rows = table.find_all('tr')
for row in table_rows:
values = row.find_all('td')
# If the row looks like a row of data, add it to the list
if(len(values) == 7 and values[0].get_text() != "Cruise Ship"):
data_to_return['summaries'].append(row_values_to_dictionary(values))
data_to_return['deficiencies'].extend(get_list_of_deficiencies_for_inspection(browser))
return data_to_return
def get_inspections_between(start_date, end_date):
start_date_str = start_date.strftime('%m/%d/%Y')
end_date_str = end_date.strftime('%m/%d/%Y')
print "INFO :: {} => {} :: About to scrape inspections".format(
start_date_str, end_date_str)
# create mechanize browser and go to search form page
browser.open('https://wwwn.cdc.gov/InspectionQueryTool/InspectionSearch.aspx')
browser.select_form(name='aspnetForm')
# set form input values and submit form
browser['ctl00$ContentPlaceHolder1$rb_InspectionDateCriteria'] = ['rb_BetweenDate']
browser['ctl00$ContentPlaceHolder1$txtFromSearchDate'] = start_date_str
browser['ctl00$ContentPlaceHolder1$txtToSearchDate'] = end_date_str
browser.submit()
# read form response (resulting HTML page) and parse the data
b = browser.response()
soup = BeautifulSoup(b.read())
data_for_range = soup_to_list_of_dictionaries(soup)
print "INFO :: {} => {} :: {} inspections, {} deficiencies".format(
start_date_str, end_date_str,
len(data_for_range['summaries']), len(data_for_range['deficiencies']))
return data_for_range
def get_list_of_deficiencies_for_inspection(browser):
deficiencies_to_return = []
for link in browser.links():
if link.text == "Report":
browser.follow_link(link)
report_page_soup = BeautifulSoup(browser.response().read())
deficiencies = report_page_soup.find_all("table",class_="tableCellBorderNone")
summary_info = deficiency_summary_info_re.search(deficiencies[0].get_text())
if summary_info:
for deficiency_row in deficiencies[2:]:
deficiency_row_details = deficiency_row_details_re.search(deficiency_row.get_text())
if deficiency_row_details:
deficiencies_to_return.append({
'cruise_ship': summary_info.group('cruise_ship').strip(' \t\n\r'),
'cruise_line': summary_info.group('cruise_line').strip(' \t\n\r'),
'inspection_score': summary_info.group('score').strip(' \t\n\r'),
'inspection_date': summary_info.group('date').strip(' \t\n\r'),
'deficiency_item_number': deficiency_row_details.group('item_number').strip(' \t\n\r'),
'deficiency_site': deficiency_row_details.group('site').strip(' \t\n\r'),
'deficiency_violation': deficiency_row_details.group('violation').strip(' \t\n\r'),
'deficiency_recommendation': deficiency_row_details.group('recommendation').strip(' \t\n\r')
})
return deficiencies_to_return
In [38]:
# GET THE DATA! ( by month :-\ )
print datetime.now()
browser = mechanize.Browser()
summaries = []
deficiencies = []
# Month-looping code adapted from StackOverflow answer
months_within_range = list(rrule.rrule(rrule.MONTHLY, dtstart=from_date).between(from_date, to_date, inc=True))
i = 0
while i < len(months_within_range) - 1:
month_start = months_within_range[i]
month_end = months_within_range[i+1] - timedelta(days=1)
data_for_period = get_inspections_between(month_start,month_end)
summaries.extend(data_for_period['summaries'])
deficiencies.extend(data_for_period['deficiencies'])
i += 1
print datetime.now()
print len(summaries)
print len(deficiencies)
2016-02-16 15:35:06.152858
INFO :: 01/01/1990 => 01/31/1990 :: About to scrape inspections
INFO :: 01/01/1990 => 01/31/1990 :: 0 inspections, 0 deficiencies
INFO :: 02/01/1990 => 02/28/1990 :: About to scrape inspections
INFO :: 02/01/1990 => 02/28/1990 :: 1 inspections, 0 deficiencies
INFO :: 03/01/1990 => 03/31/1990 :: About to scrape inspections
INFO :: 03/01/1990 => 03/31/1990 :: 2 inspections, 13 deficiencies
INFO :: 04/01/1990 => 04/30/1990 :: About to scrape inspections
INFO :: 04/01/1990 => 04/30/1990 :: 1 inspections, 0 deficiencies
INFO :: 05/01/1990 => 05/31/1990 :: About to scrape inspections
INFO :: 05/01/1990 => 05/31/1990 :: 0 inspections, 0 deficiencies
INFO :: 06/01/1990 => 06/30/1990 :: About to scrape inspections
INFO :: 06/01/1990 => 06/30/1990 :: 0 inspections, 0 deficiencies
INFO :: 07/01/1990 => 07/31/1990 :: About to scrape inspections
INFO :: 07/01/1990 => 07/31/1990 :: 1 inspections, 0 deficiencies
INFO :: 08/01/1990 => 08/31/1990 :: About to scrape inspections
INFO :: 08/01/1990 => 08/31/1990 :: 2 inspections, 15 deficiencies
INFO :: 09/01/1990 => 09/30/1990 :: About to scrape inspections
INFO :: 09/01/1990 => 09/30/1990 :: 0 inspections, 0 deficiencies
INFO :: 10/01/1990 => 10/31/1990 :: About to scrape inspections
INFO :: 10/01/1990 => 10/31/1990 :: 1 inspections, 6 deficiencies
INFO :: 11/01/1990 => 11/30/1990 :: About to scrape inspections
INFO :: 11/01/1990 => 11/30/1990 :: 0 inspections, 0 deficiencies
INFO :: 12/01/1990 => 12/31/1990 :: About to scrape inspections
INFO :: 12/01/1990 => 12/31/1990 :: 0 inspections, 0 deficiencies
INFO :: 01/01/1991 => 01/31/1991 :: About to scrape inspections
INFO :: 01/01/1991 => 01/31/1991 :: 1 inspections, 0 deficiencies
INFO :: 02/01/1991 => 02/28/1991 :: About to scrape inspections
INFO :: 02/01/1991 => 02/28/1991 :: 0 inspections, 0 deficiencies
INFO :: 03/01/1991 => 03/31/1991 :: About to scrape inspections
INFO :: 03/01/1991 => 03/31/1991 :: 0 inspections, 0 deficiencies
INFO :: 04/01/1991 => 04/30/1991 :: About to scrape inspections
INFO :: 04/01/1991 => 04/30/1991 :: 0 inspections, 0 deficiencies
INFO :: 05/01/1991 => 05/31/1991 :: About to scrape inspections
INFO :: 05/01/1991 => 05/31/1991 :: 0 inspections, 0 deficiencies
INFO :: 06/01/1991 => 06/30/1991 :: About to scrape inspections
INFO :: 06/01/1991 => 06/30/1991 :: 0 inspections, 0 deficiencies
INFO :: 07/01/1991 => 07/31/1991 :: About to scrape inspections
INFO :: 07/01/1991 => 07/31/1991 :: 0 inspections, 0 deficiencies
INFO :: 08/01/1991 => 08/31/1991 :: About to scrape inspections
INFO :: 08/01/1991 => 08/31/1991 :: 0 inspections, 0 deficiencies
INFO :: 09/01/1991 => 09/30/1991 :: About to scrape inspections
INFO :: 09/01/1991 => 09/30/1991 :: 0 inspections, 0 deficiencies
INFO :: 10/01/1991 => 10/31/1991 :: About to scrape inspections
INFO :: 10/01/1991 => 10/31/1991 :: 2 inspections, 18 deficiencies
INFO :: 11/01/1991 => 11/30/1991 :: About to scrape inspections
INFO :: 11/01/1991 => 11/30/1991 :: 0 inspections, 0 deficiencies
INFO :: 12/01/1991 => 12/31/1991 :: About to scrape inspections
INFO :: 12/01/1991 => 12/31/1991 :: 1 inspections, 7 deficiencies
INFO :: 01/01/1992 => 01/31/1992 :: About to scrape inspections
INFO :: 01/01/1992 => 01/31/1992 :: 1 inspections, 8 deficiencies
INFO :: 02/01/1992 => 02/29/1992 :: About to scrape inspections
INFO :: 02/01/1992 => 02/29/1992 :: 0 inspections, 0 deficiencies
INFO :: 03/01/1992 => 03/31/1992 :: About to scrape inspections
INFO :: 03/01/1992 => 03/31/1992 :: 3 inspections, 15 deficiencies
INFO :: 04/01/1992 => 04/30/1992 :: About to scrape inspections
INFO :: 04/01/1992 => 04/30/1992 :: 3 inspections, 17 deficiencies
INFO :: 05/01/1992 => 05/31/1992 :: About to scrape inspections
INFO :: 05/01/1992 => 05/31/1992 :: 1 inspections, 8 deficiencies
INFO :: 06/01/1992 => 06/30/1992 :: About to scrape inspections
INFO :: 06/01/1992 => 06/30/1992 :: 2 inspections, 11 deficiencies
INFO :: 07/01/1992 => 07/31/1992 :: About to scrape inspections
INFO :: 07/01/1992 => 07/31/1992 :: 1 inspections, 8 deficiencies
INFO :: 08/01/1992 => 08/31/1992 :: About to scrape inspections
INFO :: 08/01/1992 => 08/31/1992 :: 2 inspections, 11 deficiencies
INFO :: 09/01/1992 => 09/30/1992 :: About to scrape inspections
INFO :: 09/01/1992 => 09/30/1992 :: 0 inspections, 0 deficiencies
INFO :: 10/01/1992 => 10/31/1992 :: About to scrape inspections
INFO :: 10/01/1992 => 10/31/1992 :: 2 inspections, 15 deficiencies
INFO :: 11/01/1992 => 11/30/1992 :: About to scrape inspections
INFO :: 11/01/1992 => 11/30/1992 :: 0 inspections, 0 deficiencies
INFO :: 12/01/1992 => 12/31/1992 :: About to scrape inspections
INFO :: 12/01/1992 => 12/31/1992 :: 1 inspections, 4 deficiencies
INFO :: 01/01/1993 => 01/31/1993 :: About to scrape inspections
INFO :: 01/01/1993 => 01/31/1993 :: 0 inspections, 0 deficiencies
INFO :: 02/01/1993 => 02/28/1993 :: About to scrape inspections
INFO :: 02/01/1993 => 02/28/1993 :: 3 inspections, 46 deficiencies
INFO :: 03/01/1993 => 03/31/1993 :: About to scrape inspections
INFO :: 03/01/1993 => 03/31/1993 :: 3 inspections, 40 deficiencies
INFO :: 04/01/1993 => 04/30/1993 :: About to scrape inspections
INFO :: 04/01/1993 => 04/30/1993 :: 0 inspections, 0 deficiencies
INFO :: 05/01/1993 => 05/31/1993 :: About to scrape inspections
INFO :: 05/01/1993 => 05/31/1993 :: 4 inspections, 27 deficiencies
INFO :: 06/01/1993 => 06/30/1993 :: About to scrape inspections
INFO :: 06/01/1993 => 06/30/1993 :: 1 inspections, 7 deficiencies
INFO :: 07/01/1993 => 07/31/1993 :: About to scrape inspections
INFO :: 07/01/1993 => 07/31/1993 :: 1 inspections, 7 deficiencies
INFO :: 08/01/1993 => 08/31/1993 :: About to scrape inspections
INFO :: 08/01/1993 => 08/31/1993 :: 4 inspections, 27 deficiencies
INFO :: 09/01/1993 => 09/30/1993 :: About to scrape inspections
INFO :: 09/01/1993 => 09/30/1993 :: 0 inspections, 0 deficiencies
INFO :: 10/01/1993 => 10/31/1993 :: About to scrape inspections
INFO :: 10/01/1993 => 10/31/1993 :: 2 inspections, 10 deficiencies
INFO :: 11/01/1993 => 11/30/1993 :: About to scrape inspections
INFO :: 11/01/1993 => 11/30/1993 :: 3 inspections, 31 deficiencies
INFO :: 12/01/1993 => 12/31/1993 :: About to scrape inspections
INFO :: 12/01/1993 => 12/31/1993 :: 2 inspections, 5 deficiencies
INFO :: 01/01/1994 => 01/31/1994 :: About to scrape inspections
INFO :: 01/01/1994 => 01/31/1994 :: 1 inspections, 7 deficiencies
INFO :: 02/01/1994 => 02/28/1994 :: About to scrape inspections
INFO :: 02/01/1994 => 02/28/1994 :: 1 inspections, 10 deficiencies
INFO :: 03/01/1994 => 03/31/1994 :: About to scrape inspections
INFO :: 03/01/1994 => 03/31/1994 :: 1 inspections, 11 deficiencies
INFO :: 04/01/1994 => 04/30/1994 :: About to scrape inspections
INFO :: 04/01/1994 => 04/30/1994 :: 1 inspections, 24 deficiencies
INFO :: 05/01/1994 => 05/31/1994 :: About to scrape inspections
INFO :: 05/01/1994 => 05/31/1994 :: 2 inspections, 13 deficiencies
INFO :: 06/01/1994 => 06/30/1994 :: About to scrape inspections
INFO :: 06/01/1994 => 06/30/1994 :: 2 inspections, 37 deficiencies
INFO :: 07/01/1994 => 07/31/1994 :: About to scrape inspections
INFO :: 07/01/1994 => 07/31/1994 :: 3 inspections, 17 deficiencies
INFO :: 08/01/1994 => 08/31/1994 :: About to scrape inspections
INFO :: 08/01/1994 => 08/31/1994 :: 5 inspections, 60 deficiencies
INFO :: 09/01/1994 => 09/30/1994 :: About to scrape inspections
INFO :: 09/01/1994 => 09/30/1994 :: 1 inspections, 1 deficiencies
INFO :: 10/01/1994 => 10/31/1994 :: About to scrape inspections
INFO :: 10/01/1994 => 10/31/1994 :: 4 inspections, 13 deficiencies
INFO :: 11/01/1994 => 11/30/1994 :: About to scrape inspections
INFO :: 11/01/1994 => 11/30/1994 :: 1 inspections, 9 deficiencies
INFO :: 12/01/1994 => 12/31/1994 :: About to scrape inspections
INFO :: 12/01/1994 => 12/31/1994 :: 1 inspections, 11 deficiencies
INFO :: 01/01/1995 => 01/31/1995 :: About to scrape inspections
INFO :: 01/01/1995 => 01/31/1995 :: 1 inspections, 24 deficiencies
INFO :: 02/01/1995 => 02/28/1995 :: About to scrape inspections
INFO :: 02/01/1995 => 02/28/1995 :: 8 inspections, 67 deficiencies
INFO :: 03/01/1995 => 03/31/1995 :: About to scrape inspections
INFO :: 03/01/1995 => 03/31/1995 :: 2 inspections, 9 deficiencies
INFO :: 04/01/1995 => 04/30/1995 :: About to scrape inspections
INFO :: 04/01/1995 => 04/30/1995 :: 0 inspections, 0 deficiencies
INFO :: 05/01/1995 => 05/31/1995 :: About to scrape inspections
INFO :: 05/01/1995 => 05/31/1995 :: 2 inspections, 13 deficiencies
INFO :: 06/01/1995 => 06/30/1995 :: About to scrape inspections
INFO :: 06/01/1995 => 06/30/1995 :: 5 inspections, 65 deficiencies
INFO :: 07/01/1995 => 07/31/1995 :: About to scrape inspections
INFO :: 07/01/1995 => 07/31/1995 :: 4 inspections, 32 deficiencies
INFO :: 08/01/1995 => 08/31/1995 :: About to scrape inspections
INFO :: 08/01/1995 => 08/31/1995 :: 1 inspections, 2 deficiencies
INFO :: 09/01/1995 => 09/30/1995 :: About to scrape inspections
INFO :: 09/01/1995 => 09/30/1995 :: 1 inspections, 3 deficiencies
INFO :: 10/01/1995 => 10/31/1995 :: About to scrape inspections
INFO :: 10/01/1995 => 10/31/1995 :: 7 inspections, 51 deficiencies
INFO :: 11/01/1995 => 11/30/1995 :: About to scrape inspections
INFO :: 11/01/1995 => 11/30/1995 :: 2 inspections, 34 deficiencies
INFO :: 12/01/1995 => 12/31/1995 :: About to scrape inspections
INFO :: 12/01/1995 => 12/31/1995 :: 2 inspections, 28 deficiencies
INFO :: 01/01/1996 => 01/31/1996 :: About to scrape inspections
INFO :: 01/01/1996 => 01/31/1996 :: 3 inspections, 25 deficiencies
INFO :: 02/01/1996 => 02/29/1996 :: About to scrape inspections
INFO :: 02/01/1996 => 02/29/1996 :: 6 inspections, 85 deficiencies
INFO :: 03/01/1996 => 03/31/1996 :: About to scrape inspections
INFO :: 03/01/1996 => 03/31/1996 :: 3 inspections, 21 deficiencies
INFO :: 04/01/1996 => 04/30/1996 :: About to scrape inspections
INFO :: 04/01/1996 => 04/30/1996 :: 6 inspections, 86 deficiencies
INFO :: 05/01/1996 => 05/31/1996 :: About to scrape inspections
INFO :: 05/01/1996 => 05/31/1996 :: 3 inspections, 21 deficiencies
INFO :: 06/01/1996 => 06/30/1996 :: About to scrape inspections
INFO :: 06/01/1996 => 06/30/1996 :: 2 inspections, 15 deficiencies
INFO :: 07/01/1996 => 07/31/1996 :: About to scrape inspections
INFO :: 07/01/1996 => 07/31/1996 :: 3 inspections, 31 deficiencies
INFO :: 08/01/1996 => 08/31/1996 :: About to scrape inspections
INFO :: 08/01/1996 => 08/31/1996 :: 3 inspections, 21 deficiencies
INFO :: 09/01/1996 => 09/30/1996 :: About to scrape inspections
INFO :: 09/01/1996 => 09/30/1996 :: 6 inspections, 77 deficiencies
INFO :: 10/01/1996 => 10/31/1996 :: About to scrape inspections
INFO :: 10/01/1996 => 10/31/1996 :: 4 inspections, 31 deficiencies
INFO :: 11/01/1996 => 11/30/1996 :: About to scrape inspections
INFO :: 11/01/1996 => 11/30/1996 :: 3 inspections, 52 deficiencies
INFO :: 12/01/1996 => 12/31/1996 :: About to scrape inspections
INFO :: 12/01/1996 => 12/31/1996 :: 7 inspections, 79 deficiencies
INFO :: 01/01/1997 => 01/31/1997 :: About to scrape inspections
INFO :: 01/01/1997 => 01/31/1997 :: 8 inspections, 74 deficiencies
INFO :: 02/01/1997 => 02/28/1997 :: About to scrape inspections
INFO :: 02/01/1997 => 02/28/1997 :: 6 inspections, 128 deficiencies
INFO :: 03/01/1997 => 03/31/1997 :: About to scrape inspections
INFO :: 03/01/1997 => 03/31/1997 :: 5 inspections, 36 deficiencies
INFO :: 04/01/1997 => 04/30/1997 :: About to scrape inspections
INFO :: 04/01/1997 => 04/30/1997 :: 4 inspections, 54 deficiencies
INFO :: 05/01/1997 => 05/31/1997 :: About to scrape inspections
INFO :: 05/01/1997 => 05/31/1997 :: 3 inspections, 30 deficiencies
INFO :: 06/01/1997 => 06/30/1997 :: About to scrape inspections
INFO :: 06/01/1997 => 06/30/1997 :: 4 inspections, 58 deficiencies
INFO :: 07/01/1997 => 07/31/1997 :: About to scrape inspections
INFO :: 07/01/1997 => 07/31/1997 :: 10 inspections, 116 deficiencies
INFO :: 08/01/1997 => 08/31/1997 :: About to scrape inspections
INFO :: 08/01/1997 => 08/31/1997 :: 2 inspections, 43 deficiencies
INFO :: 09/01/1997 => 09/30/1997 :: About to scrape inspections
INFO :: 09/01/1997 => 09/30/1997 :: 5 inspections, 89 deficiencies
INFO :: 10/01/1997 => 10/31/1997 :: About to scrape inspections
INFO :: 10/01/1997 => 10/31/1997 :: 6 inspections, 54 deficiencies
INFO :: 11/01/1997 => 11/30/1997 :: About to scrape inspections
INFO :: 11/01/1997 => 11/30/1997 :: 2 inspections, 26 deficiencies
INFO :: 12/01/1997 => 12/31/1997 :: About to scrape inspections
INFO :: 12/01/1997 => 12/31/1997 :: 4 inspections, 42 deficiencies
INFO :: 01/01/1998 => 01/31/1998 :: About to scrape inspections
INFO :: 01/01/1998 => 01/31/1998 :: 7 inspections, 125 deficiencies
INFO :: 02/01/1998 => 02/28/1998 :: About to scrape inspections
INFO :: 02/01/1998 => 02/28/1998 :: 8 inspections, 130 deficiencies
INFO :: 03/01/1998 => 03/31/1998 :: About to scrape inspections
INFO :: 03/01/1998 => 03/31/1998 :: 2 inspections, 38 deficiencies
INFO :: 04/01/1998 => 04/30/1998 :: About to scrape inspections
INFO :: 04/01/1998 => 04/30/1998 :: 2 inspections, 33 deficiencies
INFO :: 05/01/1998 => 05/31/1998 :: About to scrape inspections
INFO :: 05/01/1998 => 05/31/1998 :: 6 inspections, 75 deficiencies
INFO :: 06/01/1998 => 06/30/1998 :: About to scrape inspections
INFO :: 06/01/1998 => 06/30/1998 :: 6 inspections, 112 deficiencies
INFO :: 07/01/1998 => 07/31/1998 :: About to scrape inspections
INFO :: 07/01/1998 => 07/31/1998 :: 6 inspections, 153 deficiencies
INFO :: 08/01/1998 => 08/31/1998 :: About to scrape inspections
INFO :: 08/01/1998 => 08/31/1998 :: 7 inspections, 163 deficiencies
INFO :: 09/01/1998 => 09/30/1998 :: About to scrape inspections
INFO :: 09/01/1998 => 09/30/1998 :: 6 inspections, 106 deficiencies
INFO :: 10/01/1998 => 10/31/1998 :: About to scrape inspections
INFO :: 10/01/1998 => 10/31/1998 :: 5 inspections, 74 deficiencies
INFO :: 11/01/1998 => 11/30/1998 :: About to scrape inspections
INFO :: 11/01/1998 => 11/30/1998 :: 2 inspections, 52 deficiencies
INFO :: 12/01/1998 => 12/31/1998 :: About to scrape inspections
INFO :: 12/01/1998 => 12/31/1998 :: 10 inspections, 188 deficiencies
INFO :: 01/01/1999 => 01/31/1999 :: About to scrape inspections
INFO :: 01/01/1999 => 01/31/1999 :: 10 inspections, 265 deficiencies
INFO :: 02/01/1999 => 02/28/1999 :: About to scrape inspections
INFO :: 02/01/1999 => 02/28/1999 :: 7 inspections, 129 deficiencies
INFO :: 03/01/1999 => 03/31/1999 :: About to scrape inspections
INFO :: 03/01/1999 => 03/31/1999 :: 8 inspections, 145 deficiencies
INFO :: 04/01/1999 => 04/30/1999 :: About to scrape inspections
INFO :: 04/01/1999 => 04/30/1999 :: 7 inspections, 75 deficiencies
INFO :: 05/01/1999 => 05/31/1999 :: About to scrape inspections
INFO :: 05/01/1999 => 05/31/1999 :: 4 inspections, 96 deficiencies
INFO :: 06/01/1999 => 06/30/1999 :: About to scrape inspections
INFO :: 06/01/1999 => 06/30/1999 :: 11 inspections, 255 deficiencies
INFO :: 07/01/1999 => 07/31/1999 :: About to scrape inspections
INFO :: 07/01/1999 => 07/31/1999 :: 3 inspections, 61 deficiencies
INFO :: 08/01/1999 => 08/31/1999 :: About to scrape inspections
INFO :: 08/01/1999 => 08/31/1999 :: 8 inspections, 200 deficiencies
INFO :: 09/01/1999 => 09/30/1999 :: About to scrape inspections
INFO :: 09/01/1999 => 09/30/1999 :: 8 inspections, 154 deficiencies
INFO :: 10/01/1999 => 10/31/1999 :: About to scrape inspections
INFO :: 10/01/1999 => 10/31/1999 :: 3 inspections, 49 deficiencies
INFO :: 11/01/1999 => 11/30/1999 :: About to scrape inspections
INFO :: 11/01/1999 => 11/30/1999 :: 5 inspections, 125 deficiencies
INFO :: 12/01/1999 => 12/31/1999 :: About to scrape inspections
INFO :: 12/01/1999 => 12/31/1999 :: 11 inspections, 247 deficiencies
INFO :: 01/01/2000 => 01/31/2000 :: About to scrape inspections
INFO :: 01/01/2000 => 01/31/2000 :: 10 inspections, 185 deficiencies
INFO :: 02/01/2000 => 02/29/2000 :: About to scrape inspections
INFO :: 02/01/2000 => 02/29/2000 :: 8 inspections, 137 deficiencies
INFO :: 03/01/2000 => 03/31/2000 :: About to scrape inspections
INFO :: 03/01/2000 => 03/31/2000 :: 5 inspections, 90 deficiencies
INFO :: 04/01/2000 => 04/30/2000 :: About to scrape inspections
INFO :: 04/01/2000 => 04/30/2000 :: 9 inspections, 162 deficiencies
INFO :: 05/01/2000 => 05/31/2000 :: About to scrape inspections
INFO :: 05/01/2000 => 05/31/2000 :: 15 inspections, 299 deficiencies
INFO :: 06/01/2000 => 06/30/2000 :: About to scrape inspections
INFO :: 06/01/2000 => 06/30/2000 :: 8 inspections, 139 deficiencies
INFO :: 07/01/2000 => 07/31/2000 :: About to scrape inspections
INFO :: 07/01/2000 => 07/31/2000 :: 6 inspections, 156 deficiencies
INFO :: 08/01/2000 => 08/31/2000 :: About to scrape inspections
INFO :: 08/01/2000 => 08/31/2000 :: 7 inspections, 153 deficiencies
INFO :: 09/01/2000 => 09/30/2000 :: About to scrape inspections
INFO :: 09/01/2000 => 09/30/2000 :: 11 inspections, 215 deficiencies
INFO :: 10/01/2000 => 10/31/2000 :: About to scrape inspections
INFO :: 10/01/2000 => 10/31/2000 :: 12 inspections, 226 deficiencies
INFO :: 11/01/2000 => 11/30/2000 :: About to scrape inspections
INFO :: 11/01/2000 => 11/30/2000 :: 6 inspections, 192 deficiencies
INFO :: 12/01/2000 => 12/31/2000 :: About to scrape inspections
INFO :: 12/01/2000 => 12/31/2000 :: 8 inspections, 229 deficiencies
INFO :: 01/01/2001 => 01/31/2001 :: About to scrape inspections
INFO :: 01/01/2001 => 01/31/2001 :: 15 inspections, 397 deficiencies
INFO :: 02/01/2001 => 02/28/2001 :: About to scrape inspections
INFO :: 02/01/2001 => 02/28/2001 :: 7 inspections, 221 deficiencies
INFO :: 03/01/2001 => 03/31/2001 :: About to scrape inspections
INFO :: 03/01/2001 => 03/31/2001 :: 7 inspections, 120 deficiencies
INFO :: 04/01/2001 => 04/30/2001 :: About to scrape inspections
INFO :: 04/01/2001 => 04/30/2001 :: 11 inspections, 274 deficiencies
INFO :: 05/01/2001 => 05/31/2001 :: About to scrape inspections
INFO :: 05/01/2001 => 05/31/2001 :: 11 inspections, 249 deficiencies
INFO :: 06/01/2001 => 06/30/2001 :: About to scrape inspections
INFO :: 06/01/2001 => 06/30/2001 :: 13 inspections, 333 deficiencies
INFO :: 07/01/2001 => 07/31/2001 :: About to scrape inspections
INFO :: 07/01/2001 => 07/31/2001 :: 6 inspections, 163 deficiencies
INFO :: 08/01/2001 => 08/31/2001 :: About to scrape inspections
INFO :: 08/01/2001 => 08/31/2001 :: 10 inspections, 118 deficiencies
INFO :: 09/01/2001 => 09/30/2001 :: About to scrape inspections
INFO :: 09/01/2001 => 09/30/2001 :: 11 inspections, 205 deficiencies
INFO :: 10/01/2001 => 10/31/2001 :: About to scrape inspections
INFO :: 10/01/2001 => 10/31/2001 :: 11 inspections, 196 deficiencies
INFO :: 11/01/2001 => 11/30/2001 :: About to scrape inspections
INFO :: 11/01/2001 => 11/30/2001 :: 10 inspections, 271 deficiencies
INFO :: 12/01/2001 => 12/31/2001 :: About to scrape inspections
INFO :: 12/01/2001 => 12/31/2001 :: 16 inspections, 261 deficiencies
INFO :: 01/01/2002 => 01/31/2002 :: About to scrape inspections
INFO :: 01/01/2002 => 01/31/2002 :: 9 inspections, 168 deficiencies
INFO :: 02/01/2002 => 02/28/2002 :: About to scrape inspections
INFO :: 02/01/2002 => 02/28/2002 :: 11 inspections, 209 deficiencies
INFO :: 03/01/2002 => 03/31/2002 :: About to scrape inspections
INFO :: 03/01/2002 => 03/31/2002 :: 9 inspections, 127 deficiencies
INFO :: 04/01/2002 => 04/30/2002 :: About to scrape inspections
INFO :: 04/01/2002 => 04/30/2002 :: 8 inspections, 135 deficiencies
INFO :: 05/01/2002 => 05/31/2002 :: About to scrape inspections
INFO :: 05/01/2002 => 05/31/2002 :: 16 inspections, 284 deficiencies
INFO :: 06/01/2002 => 06/30/2002 :: About to scrape inspections
INFO :: 06/01/2002 => 06/30/2002 :: 14 inspections, 231 deficiencies
INFO :: 07/01/2002 => 07/31/2002 :: About to scrape inspections
INFO :: 07/01/2002 => 07/31/2002 :: 12 inspections, 209 deficiencies
INFO :: 08/01/2002 => 08/31/2002 :: About to scrape inspections
INFO :: 08/01/2002 => 08/31/2002 :: 8 inspections, 162 deficiencies
INFO :: 09/01/2002 => 09/30/2002 :: About to scrape inspections
INFO :: 09/01/2002 => 09/30/2002 :: 10 inspections, 84 deficiencies
INFO :: 10/01/2002 => 10/31/2002 :: About to scrape inspections
INFO :: 10/01/2002 => 10/31/2002 :: 12 inspections, 137 deficiencies
INFO :: 11/01/2002 => 11/30/2002 :: About to scrape inspections
INFO :: 11/01/2002 => 11/30/2002 :: 18 inspections, 289 deficiencies
INFO :: 12/01/2002 => 12/31/2002 :: About to scrape inspections
INFO :: 12/01/2002 => 12/31/2002 :: 6 inspections, 89 deficiencies
INFO :: 01/01/2003 => 01/31/2003 :: About to scrape inspections
INFO :: 01/01/2003 => 01/31/2003 :: 20 inspections, 446 deficiencies
INFO :: 02/01/2003 => 02/28/2003 :: About to scrape inspections
INFO :: 02/01/2003 => 02/28/2003 :: 12 inspections, 229 deficiencies
INFO :: 03/01/2003 => 03/31/2003 :: About to scrape inspections
INFO :: 03/01/2003 => 03/31/2003 :: 13 inspections, 363 deficiencies
INFO :: 04/01/2003 => 04/30/2003 :: About to scrape inspections
INFO :: 04/01/2003 => 04/30/2003 :: 14 inspections, 234 deficiencies
INFO :: 05/01/2003 => 05/31/2003 :: About to scrape inspections
INFO :: 05/01/2003 => 05/31/2003 :: 11 inspections, 375 deficiencies
INFO :: 06/01/2003 => 06/30/2003 :: About to scrape inspections
INFO :: 06/01/2003 => 06/30/2003 :: 15 inspections, 459 deficiencies
INFO :: 07/01/2003 => 07/31/2003 :: About to scrape inspections
INFO :: 07/01/2003 => 07/31/2003 :: 15 inspections, 396 deficiencies
INFO :: 08/01/2003 => 08/31/2003 :: About to scrape inspections
INFO :: 08/01/2003 => 08/31/2003 :: 16 inspections, 351 deficiencies
INFO :: 09/01/2003 => 09/30/2003 :: About to scrape inspections
INFO :: 09/01/2003 => 09/30/2003 :: 12 inspections, 290 deficiencies
INFO :: 10/01/2003 => 10/31/2003 :: About to scrape inspections
INFO :: 10/01/2003 => 10/31/2003 :: 13 inspections, 236 deficiencies
INFO :: 11/01/2003 => 11/30/2003 :: About to scrape inspections
INFO :: 11/01/2003 => 11/30/2003 :: 18 inspections, 418 deficiencies
INFO :: 12/01/2003 => 12/31/2003 :: About to scrape inspections
INFO :: 12/01/2003 => 12/31/2003 :: 16 inspections, 312 deficiencies
INFO :: 01/01/2004 => 01/31/2004 :: About to scrape inspections
INFO :: 01/01/2004 => 01/31/2004 :: 21 inspections, 385 deficiencies
INFO :: 02/01/2004 => 02/29/2004 :: About to scrape inspections
INFO :: 02/01/2004 => 02/29/2004 :: 12 inspections, 202 deficiencies
INFO :: 03/01/2004 => 03/31/2004 :: About to scrape inspections
INFO :: 03/01/2004 => 03/31/2004 :: 13 inspections, 247 deficiencies
INFO :: 04/01/2004 => 04/30/2004 :: About to scrape inspections
INFO :: 04/01/2004 => 04/30/2004 :: 12 inspections, 220 deficiencies
INFO :: 05/01/2004 => 05/31/2004 :: About to scrape inspections
INFO :: 05/01/2004 => 05/31/2004 :: 25 inspections, 582 deficiencies
INFO :: 06/01/2004 => 06/30/2004 :: About to scrape inspections
INFO :: 06/01/2004 => 06/30/2004 :: 22 inspections, 610 deficiencies
INFO :: 07/01/2004 => 07/31/2004 :: About to scrape inspections
INFO :: 07/01/2004 => 07/31/2004 :: 12 inspections, 304 deficiencies
INFO :: 08/01/2004 => 08/31/2004 :: About to scrape inspections
INFO :: 08/01/2004 => 08/31/2004 :: 7 inspections, 126 deficiencies
INFO :: 09/01/2004 => 09/30/2004 :: About to scrape inspections
INFO :: 09/01/2004 => 09/30/2004 :: 20 inspections, 394 deficiencies
INFO :: 10/01/2004 => 10/31/2004 :: About to scrape inspections
INFO :: 10/01/2004 => 10/31/2004 :: 12 inspections, 243 deficiencies
INFO :: 11/01/2004 => 11/30/2004 :: About to scrape inspections
INFO :: 11/01/2004 => 11/30/2004 :: 19 inspections, 586 deficiencies
INFO :: 12/01/2004 => 12/31/2004 :: About to scrape inspections
INFO :: 12/01/2004 => 12/31/2004 :: 20 inspections, 568 deficiencies
INFO :: 01/01/2005 => 01/31/2005 :: About to scrape inspections
INFO :: 01/01/2005 => 01/31/2005 :: 21 inspections, 374 deficiencies
INFO :: 02/01/2005 => 02/28/2005 :: About to scrape inspections
INFO :: 02/01/2005 => 02/28/2005 :: 11 inspections, 186 deficiencies
INFO :: 03/01/2005 => 03/31/2005 :: About to scrape inspections
INFO :: 03/01/2005 => 03/31/2005 :: 17 inspections, 461 deficiencies
INFO :: 04/01/2005 => 04/30/2005 :: About to scrape inspections
INFO :: 04/01/2005 => 04/30/2005 :: 14 inspections, 410 deficiencies
INFO :: 05/01/2005 => 05/31/2005 :: About to scrape inspections
INFO :: 05/01/2005 => 05/31/2005 :: 17 inspections, 461 deficiencies
INFO :: 06/01/2005 => 06/30/2005 :: About to scrape inspections
INFO :: 06/01/2005 => 06/30/2005 :: 18 inspections, 416 deficiencies
INFO :: 07/01/2005 => 07/31/2005 :: About to scrape inspections
INFO :: 07/01/2005 => 07/31/2005 :: 15 inspections, 310 deficiencies
INFO :: 08/01/2005 => 08/31/2005 :: About to scrape inspections
INFO :: 08/01/2005 => 08/31/2005 :: 13 inspections, 383 deficiencies
INFO :: 09/01/2005 => 09/30/2005 :: About to scrape inspections
INFO :: 09/01/2005 => 09/30/2005 :: 9 inspections, 209 deficiencies
INFO :: 10/01/2005 => 10/31/2005 :: About to scrape inspections
INFO :: 10/01/2005 => 10/31/2005 :: 12 inspections, 230 deficiencies
INFO :: 11/01/2005 => 11/30/2005 :: About to scrape inspections
INFO :: 11/01/2005 => 11/30/2005 :: 17 inspections, 285 deficiencies
INFO :: 12/01/2005 => 12/31/2005 :: About to scrape inspections
INFO :: 12/01/2005 => 12/31/2005 :: 24 inspections, 368 deficiencies
INFO :: 01/01/2006 => 01/31/2006 :: About to scrape inspections
INFO :: 01/01/2006 => 01/31/2006 :: 17 inspections, 394 deficiencies
INFO :: 02/01/2006 => 02/28/2006 :: About to scrape inspections
INFO :: 02/01/2006 => 02/28/2006 :: 15 inspections, 312 deficiencies
INFO :: 03/01/2006 => 03/31/2006 :: About to scrape inspections
INFO :: 03/01/2006 => 03/31/2006 :: 16 inspections, 301 deficiencies
INFO :: 04/01/2006 => 04/30/2006 :: About to scrape inspections
INFO :: 04/01/2006 => 04/30/2006 :: 19 inspections, 479 deficiencies
INFO :: 05/01/2006 => 05/31/2006 :: About to scrape inspections
INFO :: 05/01/2006 => 05/31/2006 :: 19 inspections, 584 deficiencies
INFO :: 06/01/2006 => 06/30/2006 :: About to scrape inspections
INFO :: 06/01/2006 => 06/30/2006 :: 12 inspections, 321 deficiencies
INFO :: 07/01/2006 => 07/31/2006 :: About to scrape inspections
INFO :: 07/01/2006 => 07/31/2006 :: 21 inspections, 535 deficiencies
INFO :: 08/01/2006 => 08/31/2006 :: About to scrape inspections
INFO :: 08/01/2006 => 08/31/2006 :: 14 inspections, 388 deficiencies
INFO :: 09/01/2006 => 09/30/2006 :: About to scrape inspections
INFO :: 09/01/2006 => 09/30/2006 :: 13 inspections, 264 deficiencies
INFO :: 10/01/2006 => 10/31/2006 :: About to scrape inspections
INFO :: 10/01/2006 => 10/31/2006 :: 14 inspections, 432 deficiencies
INFO :: 11/01/2006 => 11/30/2006 :: About to scrape inspections
INFO :: 11/01/2006 => 11/30/2006 :: 21 inspections, 491 deficiencies
INFO :: 12/01/2006 => 12/31/2006 :: About to scrape inspections
INFO :: 12/01/2006 => 12/31/2006 :: 22 inspections, 510 deficiencies
INFO :: 01/01/2007 => 01/31/2007 :: About to scrape inspections
INFO :: 01/01/2007 => 01/31/2007 :: 19 inspections, 451 deficiencies
INFO :: 02/01/2007 => 02/28/2007 :: About to scrape inspections
INFO :: 02/01/2007 => 02/28/2007 :: 10 inspections, 251 deficiencies
INFO :: 03/01/2007 => 03/31/2007 :: About to scrape inspections
INFO :: 03/01/2007 => 03/31/2007 :: 16 inspections, 390 deficiencies
INFO :: 04/01/2007 => 04/30/2007 :: About to scrape inspections
INFO :: 04/01/2007 => 04/30/2007 :: 14 inspections, 340 deficiencies
INFO :: 05/01/2007 => 05/31/2007 :: About to scrape inspections
INFO :: 05/01/2007 => 05/31/2007 :: 18 inspections, 371 deficiencies
INFO :: 06/01/2007 => 06/30/2007 :: About to scrape inspections
INFO :: 06/01/2007 => 06/30/2007 :: 10 inspections, 306 deficiencies
INFO :: 07/01/2007 => 07/31/2007 :: About to scrape inspections
INFO :: 07/01/2007 => 07/31/2007 :: 17 inspections, 420 deficiencies
INFO :: 08/01/2007 => 08/31/2007 :: About to scrape inspections
INFO :: 08/01/2007 => 08/31/2007 :: 13 inspections, 297 deficiencies
INFO :: 09/01/2007 => 09/30/2007 :: About to scrape inspections
INFO :: 09/01/2007 => 09/30/2007 :: 11 inspections, 305 deficiencies
INFO :: 10/01/2007 => 10/31/2007 :: About to scrape inspections
INFO :: 10/01/2007 => 10/31/2007 :: 20 inspections, 500 deficiencies
INFO :: 11/01/2007 => 11/30/2007 :: About to scrape inspections
INFO :: 11/01/2007 => 11/30/2007 :: 19 inspections, 439 deficiencies
INFO :: 12/01/2007 => 12/31/2007 :: About to scrape inspections
INFO :: 12/01/2007 => 12/31/2007 :: 17 inspections, 367 deficiencies
INFO :: 01/01/2008 => 01/31/2008 :: About to scrape inspections
INFO :: 01/01/2008 => 01/31/2008 :: 21 inspections, 527 deficiencies
INFO :: 02/01/2008 => 02/29/2008 :: About to scrape inspections
INFO :: 02/01/2008 => 02/29/2008 :: 15 inspections, 448 deficiencies
INFO :: 03/01/2008 => 03/31/2008 :: About to scrape inspections
INFO :: 03/01/2008 => 03/31/2008 :: 18 inspections, 574 deficiencies
INFO :: 04/01/2008 => 04/30/2008 :: About to scrape inspections
INFO :: 04/01/2008 => 04/30/2008 :: 27 inspections, 791 deficiencies
INFO :: 05/01/2008 => 05/31/2008 :: About to scrape inspections
INFO :: 05/01/2008 => 05/31/2008 :: 17 inspections, 512 deficiencies
INFO :: 06/01/2008 => 06/30/2008 :: About to scrape inspections
INFO :: 06/01/2008 => 06/30/2008 :: 13 inspections, 315 deficiencies
INFO :: 07/01/2008 => 07/31/2008 :: About to scrape inspections
INFO :: 07/01/2008 => 07/31/2008 :: 13 inspections, 447 deficiencies
INFO :: 08/01/2008 => 08/31/2008 :: About to scrape inspections
INFO :: 08/01/2008 => 08/31/2008 :: 12 inspections, 314 deficiencies
INFO :: 09/01/2008 => 09/30/2008 :: About to scrape inspections
INFO :: 09/01/2008 => 09/30/2008 :: 15 inspections, 392 deficiencies
INFO :: 10/01/2008 => 10/31/2008 :: About to scrape inspections
INFO :: 10/01/2008 => 10/31/2008 :: 20 inspections, 650 deficiencies
INFO :: 11/01/2008 => 11/30/2008 :: About to scrape inspections
INFO :: 11/01/2008 => 11/30/2008 :: 23 inspections, 683 deficiencies
INFO :: 12/01/2008 => 12/31/2008 :: About to scrape inspections
INFO :: 12/01/2008 => 12/31/2008 :: 22 inspections, 687 deficiencies
INFO :: 01/01/2009 => 01/31/2009 :: About to scrape inspections
INFO :: 01/01/2009 => 01/31/2009 :: 13 inspections, 323 deficiencies
INFO :: 02/01/2009 => 02/28/2009 :: About to scrape inspections
INFO :: 02/01/2009 => 02/28/2009 :: 15 inspections, 547 deficiencies
INFO :: 03/01/2009 => 03/31/2009 :: About to scrape inspections
INFO :: 03/01/2009 => 03/31/2009 :: 20 inspections, 609 deficiencies
INFO :: 04/01/2009 => 04/30/2009 :: About to scrape inspections
INFO :: 04/01/2009 => 04/30/2009 :: 32 inspections, 892 deficiencies
INFO :: 05/01/2009 => 05/31/2009 :: About to scrape inspections
INFO :: 05/01/2009 => 05/31/2009 :: 19 inspections, 570 deficiencies
INFO :: 06/01/2009 => 06/30/2009 :: About to scrape inspections
INFO :: 06/01/2009 => 06/30/2009 :: 12 inspections, 410 deficiencies
INFO :: 07/01/2009 => 07/31/2009 :: About to scrape inspections
INFO :: 07/01/2009 => 07/31/2009 :: 12 inspections, 363 deficiencies
INFO :: 08/01/2009 => 08/31/2009 :: About to scrape inspections
INFO :: 08/01/2009 => 08/31/2009 :: 12 inspections, 364 deficiencies
INFO :: 09/01/2009 => 09/30/2009 :: About to scrape inspections
INFO :: 09/01/2009 => 09/30/2009 :: 20 inspections, 601 deficiencies
INFO :: 10/01/2009 => 10/31/2009 :: About to scrape inspections
INFO :: 10/01/2009 => 10/31/2009 :: 18 inspections, 459 deficiencies
INFO :: 11/01/2009 => 11/30/2009 :: About to scrape inspections
INFO :: 11/01/2009 => 11/30/2009 :: 21 inspections, 570 deficiencies
INFO :: 12/01/2009 => 12/31/2009 :: About to scrape inspections
INFO :: 12/01/2009 => 12/31/2009 :: 23 inspections, 664 deficiencies
INFO :: 01/01/2010 => 01/31/2010 :: About to scrape inspections
INFO :: 01/01/2010 => 01/31/2010 :: 24 inspections, 759 deficiencies
INFO :: 02/01/2010 => 02/28/2010 :: About to scrape inspections
INFO :: 02/01/2010 => 02/28/2010 :: 16 inspections, 553 deficiencies
INFO :: 03/01/2010 => 03/31/2010 :: About to scrape inspections
INFO :: 03/01/2010 => 03/31/2010 :: 25 inspections, 601 deficiencies
INFO :: 04/01/2010 => 04/30/2010 :: About to scrape inspections
INFO :: 04/01/2010 => 04/30/2010 :: 16 inspections, 449 deficiencies
INFO :: 05/01/2010 => 05/31/2010 :: About to scrape inspections
INFO :: 05/01/2010 => 05/31/2010 :: 23 inspections, 563 deficiencies
INFO :: 06/01/2010 => 06/30/2010 :: About to scrape inspections
INFO :: 06/01/2010 => 06/30/2010 :: 17 inspections, 481 deficiencies
INFO :: 07/01/2010 => 07/31/2010 :: About to scrape inspections
INFO :: 07/01/2010 => 07/31/2010 :: 17 inspections, 448 deficiencies
INFO :: 08/01/2010 => 08/31/2010 :: About to scrape inspections
INFO :: 08/01/2010 => 08/31/2010 :: 16 inspections, 392 deficiencies
INFO :: 09/01/2010 => 09/30/2010 :: About to scrape inspections
INFO :: 09/01/2010 => 09/30/2010 :: 10 inspections, 326 deficiencies
INFO :: 10/01/2010 => 10/31/2010 :: About to scrape inspections
INFO :: 10/01/2010 => 10/31/2010 :: 24 inspections, 519 deficiencies
INFO :: 11/01/2010 => 11/30/2010 :: About to scrape inspections
INFO :: 11/01/2010 => 11/30/2010 :: 19 inspections, 553 deficiencies
INFO :: 12/01/2010 => 12/31/2010 :: About to scrape inspections
INFO :: 12/01/2010 => 12/31/2010 :: 20 inspections, 515 deficiencies
INFO :: 01/01/2011 => 01/31/2011 :: About to scrape inspections
INFO :: 01/01/2011 => 01/31/2011 :: 20 inspections, 434 deficiencies
INFO :: 02/01/2011 => 02/28/2011 :: About to scrape inspections
INFO :: 02/01/2011 => 02/28/2011 :: 22 inspections, 452 deficiencies
INFO :: 03/01/2011 => 03/31/2011 :: About to scrape inspections
INFO :: 03/01/2011 => 03/31/2011 :: 17 inspections, 314 deficiencies
INFO :: 04/01/2011 => 04/30/2011 :: About to scrape inspections
INFO :: 04/01/2011 => 04/30/2011 :: 26 inspections, 555 deficiencies
INFO :: 05/01/2011 => 05/31/2011 :: About to scrape inspections
INFO :: 05/01/2011 => 05/31/2011 :: 20 inspections, 394 deficiencies
INFO :: 06/01/2011 => 06/30/2011 :: About to scrape inspections
INFO :: 06/01/2011 => 06/30/2011 :: 20 inspections, 592 deficiencies
INFO :: 07/01/2011 => 07/31/2011 :: About to scrape inspections
INFO :: 07/01/2011 => 07/31/2011 :: 16 inspections, 445 deficiencies
INFO :: 08/01/2011 => 08/31/2011 :: About to scrape inspections
INFO :: 08/01/2011 => 08/31/2011 :: 16 inspections, 312 deficiencies
INFO :: 09/01/2011 => 09/30/2011 :: About to scrape inspections
INFO :: 09/01/2011 => 09/30/2011 :: 17 inspections, 360 deficiencies
INFO :: 10/01/2011 => 10/31/2011 :: About to scrape inspections
INFO :: 10/01/2011 => 10/31/2011 :: 19 inspections, 696 deficiencies
INFO :: 11/01/2011 => 11/30/2011 :: About to scrape inspections
INFO :: 11/01/2011 => 11/30/2011 :: 21 inspections, 807 deficiencies
INFO :: 12/01/2011 => 12/31/2011 :: About to scrape inspections
INFO :: 12/01/2011 => 12/31/2011 :: 26 inspections, 871 deficiencies
INFO :: 01/01/2012 => 01/31/2012 :: About to scrape inspections
INFO :: 01/01/2012 => 01/31/2012 :: 27 inspections, 999 deficiencies
INFO :: 02/01/2012 => 02/29/2012 :: About to scrape inspections
INFO :: 02/01/2012 => 02/29/2012 :: 20 inspections, 785 deficiencies
INFO :: 03/01/2012 => 03/31/2012 :: About to scrape inspections
INFO :: 03/01/2012 => 03/31/2012 :: 31 inspections, 1132 deficiencies
INFO :: 04/01/2012 => 04/30/2012 :: About to scrape inspections
INFO :: 04/01/2012 => 04/30/2012 :: 19 inspections, 719 deficiencies
INFO :: 05/01/2012 => 05/31/2012 :: About to scrape inspections
INFO :: 05/01/2012 => 05/31/2012 :: 19 inspections, 687 deficiencies
INFO :: 06/01/2012 => 06/30/2012 :: About to scrape inspections
INFO :: 06/01/2012 => 06/30/2012 :: 15 inspections, 427 deficiencies
INFO :: 07/01/2012 => 07/31/2012 :: About to scrape inspections
INFO :: 07/01/2012 => 07/31/2012 :: 24 inspections, 826 deficiencies
INFO :: 08/01/2012 => 08/31/2012 :: About to scrape inspections
INFO :: 08/01/2012 => 08/31/2012 :: 12 inspections, 446 deficiencies
INFO :: 09/01/2012 => 09/30/2012 :: About to scrape inspections
INFO :: 09/01/2012 => 09/30/2012 :: 18 inspections, 615 deficiencies
INFO :: 10/01/2012 => 10/31/2012 :: About to scrape inspections
INFO :: 10/01/2012 => 10/31/2012 :: 22 inspections, 794 deficiencies
INFO :: 11/01/2012 => 11/30/2012 :: About to scrape inspections
INFO :: 11/01/2012 => 11/30/2012 :: 14 inspections, 466 deficiencies
INFO :: 12/01/2012 => 12/31/2012 :: About to scrape inspections
INFO :: 12/01/2012 => 12/31/2012 :: 19 inspections, 593 deficiencies
INFO :: 01/01/2013 => 01/31/2013 :: About to scrape inspections
INFO :: 01/01/2013 => 01/31/2013 :: 17 inspections, 489 deficiencies
INFO :: 02/01/2013 => 02/28/2013 :: About to scrape inspections
INFO :: 02/01/2013 => 02/28/2013 :: 21 inspections, 755 deficiencies
INFO :: 03/01/2013 => 03/31/2013 :: About to scrape inspections
INFO :: 03/01/2013 => 03/31/2013 :: 17 inspections, 562 deficiencies
INFO :: 04/01/2013 => 04/30/2013 :: About to scrape inspections
INFO :: 04/01/2013 => 04/30/2013 :: 16 inspections, 481 deficiencies
INFO :: 05/01/2013 => 05/31/2013 :: About to scrape inspections
INFO :: 05/01/2013 => 05/31/2013 :: 19 inspections, 554 deficiencies
INFO :: 06/01/2013 => 06/30/2013 :: About to scrape inspections
INFO :: 06/01/2013 => 06/30/2013 :: 23 inspections, 815 deficiencies
INFO :: 07/01/2013 => 07/31/2013 :: About to scrape inspections
INFO :: 07/01/2013 => 07/31/2013 :: 18 inspections, 518 deficiencies
INFO :: 08/01/2013 => 08/31/2013 :: About to scrape inspections
INFO :: 08/01/2013 => 08/31/2013 :: 27 inspections, 770 deficiencies
INFO :: 09/01/2013 => 09/30/2013 :: About to scrape inspections
INFO :: 09/01/2013 => 09/30/2013 :: 18 inspections, 469 deficiencies
INFO :: 10/01/2013 => 10/31/2013 :: About to scrape inspections
INFO :: 10/01/2013 => 10/31/2013 :: 20 inspections, 560 deficiencies
INFO :: 11/01/2013 => 11/30/2013 :: About to scrape inspections
INFO :: 11/01/2013 => 11/30/2013 :: 22 inspections, 593 deficiencies
INFO :: 12/01/2013 => 12/31/2013 :: About to scrape inspections
INFO :: 12/01/2013 => 12/31/2013 :: 23 inspections, 637 deficiencies
INFO :: 01/01/2014 => 01/31/2014 :: About to scrape inspections
INFO :: 01/01/2014 => 01/31/2014 :: 23 inspections, 723 deficiencies
INFO :: 02/01/2014 => 02/28/2014 :: About to scrape inspections
INFO :: 02/01/2014 => 02/28/2014 :: 18 inspections, 525 deficiencies
INFO :: 03/01/2014 => 03/31/2014 :: About to scrape inspections
INFO :: 03/01/2014 => 03/31/2014 :: 28 inspections, 881 deficiencies
INFO :: 04/01/2014 => 04/30/2014 :: About to scrape inspections
INFO :: 04/01/2014 => 04/30/2014 :: 18 inspections, 507 deficiencies
INFO :: 05/01/2014 => 05/31/2014 :: About to scrape inspections
INFO :: 05/01/2014 => 05/31/2014 :: 23 inspections, 660 deficiencies
INFO :: 06/01/2014 => 06/30/2014 :: About to scrape inspections
INFO :: 06/01/2014 => 06/30/2014 :: 20 inspections, 422 deficiencies
INFO :: 07/01/2014 => 07/31/2014 :: About to scrape inspections
INFO :: 07/01/2014 => 07/31/2014 :: 26 inspections, 939 deficiencies
INFO :: 08/01/2014 => 08/31/2014 :: About to scrape inspections
INFO :: 08/01/2014 => 08/31/2014 :: 16 inspections, 393 deficiencies
INFO :: 09/01/2014 => 09/30/2014 :: About to scrape inspections
INFO :: 09/01/2014 => 09/30/2014 :: 18 inspections, 554 deficiencies
INFO :: 10/01/2014 => 10/31/2014 :: About to scrape inspections
INFO :: 10/01/2014 => 10/31/2014 :: 17 inspections, 481 deficiencies
INFO :: 11/01/2014 => 11/30/2014 :: About to scrape inspections
INFO :: 11/01/2014 => 11/30/2014 :: 20 inspections, 542 deficiencies
INFO :: 12/01/2014 => 12/31/2014 :: About to scrape inspections
INFO :: 12/01/2014 => 12/31/2014 :: 26 inspections, 598 deficiencies
INFO :: 01/01/2015 => 01/31/2015 :: About to scrape inspections
INFO :: 01/01/2015 => 01/31/2015 :: 26 inspections, 644 deficiencies
INFO :: 02/01/2015 => 02/28/2015 :: About to scrape inspections
INFO :: 02/01/2015 => 02/28/2015 :: 21 inspections, 529 deficiencies
INFO :: 03/01/2015 => 03/31/2015 :: About to scrape inspections
INFO :: 03/01/2015 => 03/31/2015 :: 35 inspections, 851 deficiencies
INFO :: 04/01/2015 => 04/30/2015 :: About to scrape inspections
INFO :: 04/01/2015 => 04/30/2015 :: 21 inspections, 490 deficiencies
INFO :: 05/01/2015 => 05/31/2015 :: About to scrape inspections
INFO :: 05/01/2015 => 05/31/2015 :: 26 inspections, 628 deficiencies
INFO :: 06/01/2015 => 06/30/2015 :: About to scrape inspections
INFO :: 06/01/2015 => 06/30/2015 :: 16 inspections, 471 deficiencies
INFO :: 07/01/2015 => 07/31/2015 :: About to scrape inspections
INFO :: 07/01/2015 => 07/31/2015 :: 23 inspections, 580 deficiencies
INFO :: 08/01/2015 => 08/31/2015 :: About to scrape inspections
INFO :: 08/01/2015 => 08/31/2015 :: 17 inspections, 318 deficiencies
INFO :: 09/01/2015 => 09/30/2015 :: About to scrape inspections
INFO :: 09/01/2015 => 09/30/2015 :: 21 inspections, 567 deficiencies
INFO :: 10/01/2015 => 10/31/2015 :: About to scrape inspections
INFO :: 10/01/2015 => 10/31/2015 :: 20 inspections, 522 deficiencies
INFO :: 11/01/2015 => 11/30/2015 :: About to scrape inspections
INFO :: 11/01/2015 => 11/30/2015 :: 18 inspections, 396 deficiencies
INFO :: 12/01/2015 => 12/31/2015 :: About to scrape inspections
INFO :: 12/01/2015 => 12/31/2015 :: 10 inspections, 307 deficiencies
INFO :: 01/01/2016 => 01/31/2016 :: About to scrape inspections
INFO :: 01/01/2016 => 01/31/2016 :: 1 inspections, 15 deficiencies
3569
88811
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-38-219e18745700> in <module>()
21 print len(summaries)
22 print len(deficiencies)
---> 23 print datetime.datetime.now()
AttributeError: type object 'datetime.datetime' has no attribute 'datetime'
In [41]:
# DO STUFF WITH THE DATA
# First things first, convert the dictionary to a pandas dataframe
summaries_df = pandas.DataFrame.from_dict(summaries)
summaries_df = summaries_df.dropna(how='all') # remove empty rows
summaries_df.to_csv('summaries-19900101thru20160131.csv',index=False,encoding='utf-8')
# print summaries_df.to_csv()
deficiencies_df = pandas.DataFrame.from_dict(deficiencies)
deficiencies_df = deficiencies_df.dropna(how='all') # remove empty rows
deficiencies_df.to_csv('deficiencies-19900101thru20160131.csv',index=False,encoding='utf-8')
# print deficiencies_df.to_csv()
2016-02-16 16:34:53.366769
In [ ]:
# Questions? Happy to help.. just email mark.silverberg@socrata.com
Content source: marks/cdc-cruise-ship-inspections
Similar notebooks: