From 657693111b5cc446387e410e4169f220dc84fcd2 Mon Sep 17 00:00:00 2001 From: "duncan.parkes" Date: Tue, 9 Sep 2008 17:56:37 +0000 Subject: [PATCH] Add Waltham Forest. --- python_scrapers/PlanningExplorer.py | 25 ++++++++++++++----------- python_scrapers/SitesToGenerate.csv | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/python_scrapers/PlanningExplorer.py b/python_scrapers/PlanningExplorer.py index ebdef7e..3d6a498 100644 --- a/python_scrapers/PlanningExplorer.py +++ b/python_scrapers/PlanningExplorer.py @@ -638,12 +638,16 @@ class WestOxfordshireParser(PlanningExplorerParser): use_firefox_user_agent = True class WalthamForestParser(PlanningExplorerParser): - address_td_no = 2 - description_td_no = 3 - search_url_path = "PlanningExplorer/GeneralSearch.aspx" info_url_path = "PlanningExplorer/Generic/" use_firefox_user_agent = True + use_referer = True + + # I know - I should change this so that the attribute is not comments_email_address, but + # something more general + comments_email_address = "https://www1.walthamforest.gov.uk/webforms/plan_comments/" + + results_table_attrs = {"class": "display_table"} def _getPostData(self, asp_args, search_date): post_data = urllib.urlencode(asp_args + ( @@ -656,18 +660,17 @@ class WalthamForestParser(PlanningExplorerParser): ("cboApplicationTypeCode", ""), ("cboDevelopmentTypeCode", ""), ("cboStatusCode", ""), - ("cboSelectDateValue", "DATE_RECEIVED"), + ("cboSelectDateValue", "DATE_REGISTERED"), ("cboMonths", "1"), - ("cboDays", "1"), + ("cboDays", "10"), ("rbGroup", "rbRange"), ("dateStart", search_date.strftime(date_format)), ("dateEnd", search_date.strftime(date_format)), - #&dateStart=01%2F03%2F2008&dateEnd=01%2F04%2F2008& ("edrDateSelection", ""), ("csbtnSearch", "Search"), - )) + ) + ) - print post_data return post_data class ConwyParser(BroadlandLike, PlanningExplorerParser): @@ -713,7 +716,7 @@ if __name__ == '__main__': # parser = ForestHeathParser("Forest Heath District Council", "Forest Heath", "http://195.171.177.73/") # parser = HackneyParser("London Borough of Hackney", "Hackney", "http://www.hackney.gov.uk/servapps/") # parser = KennetParser("Kennet District Council", "Kennet", "http://mvm-planning.kennet.gov.uk/") - parser = LincolnParser("Lincoln City Council", "Lincoln", "http://online.lincoln.gov.uk/") +# parser = LincolnParser("Lincoln City Council", "Lincoln", "http://online.lincoln.gov.uk/") # parser = LiverpoolParser("Liverpool City Council", "Liverpool", "http://www.liverpool.gov.uk/") # parser = ShrewsburyParser("Shrewsbury and Atcham Borough Council", "Shrewsbury", "http://www2.shrewsbury.gov.uk/") # parser = SouthNorfolkParser("South Norfolk Council", "South Norfolk", "http://planning.south-norfolk.gov.uk/") @@ -724,10 +727,10 @@ if __name__ == '__main__': # parser = TamworthParser("Tamworth Borough Council", "Tamworth", "http://80.1.64.77/") # parser = TraffordParser("Trafford Council", "Trafford", "http://planning.trafford.gov.uk/") # parser = WestOxfordshireParser("West Oxfordshire District Council", "West Oxfordshire", "http://planning.westoxon.gov.uk/") -# parser = WalthamForestParser("Waltham Forest", "Waltham Forest", "http://planning.walthamforest.gov.uk/") + parser = WalthamForestParser("Waltham Forest", "Waltham Forest", "http://planning.walthamforest.gov.uk/") # parser = ConwyParser("Conwy County Borough Council", "Conwy", "http://www.conwy.gov.uk/") # parser = MertonParser("London Borough of Merton", "Merton", "http://planning.merton.gov.uk") - print parser.getResults(9, 9, 2008) + print parser.getResults(28, 8, 2008) # To Do diff --git a/python_scrapers/SitesToGenerate.csv b/python_scrapers/SitesToGenerate.csv index 0a22dba..91cbd9d 100644 --- a/python_scrapers/SitesToGenerate.csv +++ b/python_scrapers/SitesToGenerate.csv @@ -262,3 +262,4 @@ "Herefordshire Council", "Herefordshire", "", "Herefordshire", "HerefordshireParser" "Exmoor National Park", "Exmoor", "", "Exmoor", "ExmoorParser" "Eastbourne Borough Council", "Eastbourne", "", "Eastbourne", "EastbourneParser" +"Waltham Forest Council", "Waltham Forest", "http://planning.walthamforest.gov.uk/", "PlanningExplorer", "WalthamForestParser"