| @@ -90,7 +90,7 @@ class PlanningApplication: | |||||
| return self.displayXML() | return self.displayXML() | ||||
| def displayXML(self): | def displayXML(self): | ||||
| #print self.council_reference, self.address, self.postcode, self.description, self.info_url, self.comment_url, self.date_received | |||||
| print self.council_reference, self.address, self.postcode, self.description, self.info_url, self.comment_url, self.date_received | |||||
| return "<application>\n" +\ | return "<application>\n" +\ | ||||
| "<council_reference>%s</council_reference>\n" %xmlQuote(self.council_reference) +\ | "<council_reference>%s</council_reference>\n" %xmlQuote(self.council_reference) +\ | ||||
| "<address>%s</address>\n" %xmlQuote(self.address) +\ | "<address>%s</address>\n" %xmlQuote(self.address) +\ | ||||
| @@ -65,7 +65,9 @@ class PublicAccessParser(HTMLParser.HTMLParser): | |||||
| self.handle_start_td(attrs) | self.handle_start_td(attrs) | ||||
| # we are only interested in <a> tags if we are in the 6th td in | # we are only interested in <a> tags if we are in the 6th td in | ||||
| # the results table. | # the results table. | ||||
| elif self._in_td and self._td_count == 6 and tag == "a": | |||||
| # UPDATE: It seems that, in the case of Chiltern, we are interested in | |||||
| # td 5. | |||||
| elif self._in_td and (self._td_count == 5 or self._td_count == 6) and tag == "a": | |||||
| self.handle_start_a(attrs) | self.handle_start_a(attrs) | ||||
| # If the tag is not one of these then we aren't interested | # If the tag is not one of these then we aren't interested | ||||
| @@ -128,7 +130,7 @@ class PublicAccessParser(HTMLParser.HTMLParser): | |||||
| # go through the attributes of the <a> looking for one | # go through the attributes of the <a> looking for one | ||||
| # named 'href' | # named 'href' | ||||
| for attr,value in attrs: | |||||
| for attr,value in attrs: | |||||
| if attr == "href": | if attr == "href": | ||||
| # the value of this tag is a relative url. | # the value of this tag is a relative url. | ||||
| # parse it so we can get the query string from it | # parse it so we can get the query string from it | ||||
| @@ -90,7 +90,7 @@ class PlanningApplication: | |||||
| return self.displayXML() | return self.displayXML() | ||||
| def displayXML(self): | def displayXML(self): | ||||
| #print self.council_reference, self.address, self.postcode, self.description, self.info_url, self.comment_url, self.date_received | |||||
| print self.council_reference, self.address, self.postcode, self.description, self.info_url, self.comment_url, self.date_received | |||||
| return "<application>\n" +\ | return "<application>\n" +\ | ||||
| "<council_reference>%s</council_reference>\n" %xmlQuote(self.council_reference) +\ | "<council_reference>%s</council_reference>\n" %xmlQuote(self.council_reference) +\ | ||||
| "<address>%s</address>\n" %xmlQuote(self.address) +\ | "<address>%s</address>\n" %xmlQuote(self.address) +\ | ||||
| @@ -65,7 +65,9 @@ class PublicAccessParser(HTMLParser.HTMLParser): | |||||
| self.handle_start_td(attrs) | self.handle_start_td(attrs) | ||||
| # we are only interested in <a> tags if we are in the 6th td in | # we are only interested in <a> tags if we are in the 6th td in | ||||
| # the results table. | # the results table. | ||||
| elif self._in_td and self._td_count == 6 and tag == "a": | |||||
| # UPDATE: It seems that, in the case of Chiltern, we are interested in | |||||
| # td 5. | |||||
| elif self._in_td and (self._td_count == 5 or self._td_count == 6) and tag == "a": | |||||
| self.handle_start_a(attrs) | self.handle_start_a(attrs) | ||||
| # If the tag is not one of these then we aren't interested | # If the tag is not one of these then we aren't interested | ||||
| @@ -128,7 +130,7 @@ class PublicAccessParser(HTMLParser.HTMLParser): | |||||
| # go through the attributes of the <a> looking for one | # go through the attributes of the <a> looking for one | ||||
| # named 'href' | # named 'href' | ||||
| for attr,value in attrs: | |||||
| for attr,value in attrs: | |||||
| if attr == "href": | if attr == "href": | ||||
| # the value of this tag is a relative url. | # the value of this tag is a relative url. | ||||
| # parse it so we can get the query string from it | # parse it so we can get the query string from it | ||||