Bladeren bron

Add info url for Elmbridge.

import/raw
duncan.parkes@gmail.com 15 jaren geleden
bovenliggende
commit
8c9ad9213c
2 gewijzigde bestanden met toevoegingen van 19 en 6 verwijderingen
  1. +1
    -1
      trunk/SitesToGenerate.csv
  2. +18
    -5
      trunk/python_scrapers/Planet.py

+ 1
- 1
trunk/SitesToGenerate.csv Bestand weergeven

@@ -102,7 +102,7 @@
"Eden District Council","Eden",,,,,,"http://eforms.eden.gov.uk/fastweb/","FastWeb","FastWeb",
"The City of Edinburgh Council","Edinburgh",,,,,,"http://citydev-portal.edinburgh.gov.uk/publicaccess/tdc/","PublicAccess","PublicAccessParser",
"Ellesmere Port and Neston Borough Council","Ellesmere Port",,,,,,"http://ocella.epnbc.gov.uk/portal/page?_pageid=33,38205&_dad=portal&_schema=PORTAL","Ocella","OcellaParser",
"Elmbridge Borough Council","Elmbridge",,,,,,"http://www2.elmbridge.gov.uk/Planet/ispforms.asp?serviceKey=SysDoc-PlanetApplicationEnquiry","Planet","PlanetParser",
"Elmbridge Borough Council","Elmbridge",,,,,,"http://www2.elmbridge.gov.uk/Planet/ispforms.asp?serviceKey=SysDoc-PlanetApplicationEnquiry","Planet","ElmbridgeParser",
"London Borough of Enfield","Enfield",,,,,,"http://forms.enfield.gov.uk/swiftlg/apas/run/wphappcriteria.display","SwiftLG","SwiftLGParser",
"Epping Forest District Council","Epping Forest",,"http://duncan.devel.disruptiveproactivity.com/Epping%20Forest.cgi?day={day}&month={month}&year={year}",1,,,"http://plan1.eppingforestdc.gov.uk/","PlanningExplorer","EppingForestParser",
"Epsom and Ewell Borough Council","Epsom and Ewell",,,,,,"http://eplanning.epsom-ewell.gov.uk/publicaccess/tdc/","PublicAccess","PublicAccessParser",


+ 18
- 5
trunk/python_scrapers/Planet.py Bestand weergeven

@@ -33,6 +33,12 @@ class PlanetParser:

self._results = PlanningAuthorityResults(self.authority_name, self.authority_short_name)

def get_info_url(self, soup_fragment):
return self.base_url

def get_comment_url(self, soup_fragment):
return self.get_info_url(soup_fragment)

def getResultsByDayMonthYear(self, day, month, year):
# What is the serviceKey for this council?
# It's in our base url
@@ -101,10 +107,10 @@ class PlanetParser:
self._current_application.description = tds[2].string.strip()

# There is no good info url, so we just give the search page.
self._current_application.info_url = self.base_url
self._current_application.info_url = self.get_info_url(tr)

# Similarly for the comment url
self._current_application.comment_url = self.base_url
self._current_application.comment_url = self.get_comment_url(tr)
self._results.addApplication(self._current_application)
@@ -146,13 +152,20 @@ class PlanetParser:
return self.getResultsByDayMonthYear(int(day), int(month), int(year)).displayXML()


class ElmbridgeParser(PlanetParser):
info_url_template = "http://emaps.elmbridge.gov.uk/LinkToSoftwareAG.aspx?appref=%s"
def get_info_url(self, soup_fragment):
return self.info_url_template %self._current_application.council_reference


if __name__ == '__main__':
# parser = PlanetParser("Elmbridge Borough Council", "Elmbridge", "http://www2.elmbridge.gov.uk/Planet/ispforms.asp?serviceKey=SysDoc-PlanetApplicationEnquiry")
parser = ElmbridgeParser("Elmbridge Borough Council", "Elmbridge", "http://www2.elmbridge.gov.uk/Planet/ispforms.asp?serviceKey=SysDoc-PlanetApplicationEnquiry")
# parser = PlanetParser("North Lincolnshire Council", "North Lincolnshire", "http://www.planning.northlincs.gov.uk/planet/ispforms.asp?ServiceKey=SysDoc-PlanetApplicationEnquiry")
# parser = PlanetParser("Rydale District Council", "Rydale", "http://www.ryedale.gov.uk/ispforms.asp?serviceKey=SysDoc-PlanetApplicationEnquiry")
parser = PlanetParser("Tewkesbury Borough Council", "Tewkesbury", "http://planning.tewkesbury.gov.uk/Planet/ispforms.asp?serviceKey=07WCC04163103430")
print parser.getResults(20,11,2008)
# parser = PlanetParser("Tewkesbury Borough Council", "Tewkesbury", "http://planning.tewkesbury.gov.uk/Planet/ispforms.asp?serviceKey=07WCC04163103430")
# parser = PlanetParser("Worcester City Council", "Worcester", "http://www.worcester.gov.uk:8080/planet/ispforms.asp?serviceKey=SysDoc-PlanetApplicationEnquiry", debug=True)
print parser.getResults(1,5,2009)

# TODO



Laden…
Annuleren
Opslaan