瀏覽代碼

Replace the datetime.strptime with a workaround for python 2.4

master
duncan.parkes 17 年之前
父節點
當前提交
2e5ab87650
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. +8
    -1
      python_scrapers/AtriumePlanning.py
  2. +1
    -1
      python_scrapers/RutlandLike.py

+ 8
- 1
python_scrapers/AtriumePlanning.py 查看文件

@@ -68,7 +68,14 @@ class AtriumePlanningParser:
if td.string.strip() == "Date Registered":
# We are starting a new App
self._current_application = PlanningApplication()
self._current_application.date_received = datetime.datetime.strptime(td.findNext("td").string, "%d-%m-%Y")

#
day, month, year = [int(x) for x in td.findNext("td").string.split("-")]
self._current_application.date_received = datetime.date(year, month, day)
# FIXME - when python on haggis is a bit newer,
#we can do the following, which is neater
#(and get rid of the import of time).
#self._current_application.date_received = datetime.datetime.strptime(td.findNext("td").string, "%d-%m-%Y")
elif td.string.strip() == "Application Number":
self._current_application.council_reference = td.findNext("td").string
elif td.string.strip() == "Location":


+ 1
- 1
python_scrapers/RutlandLike.py 查看文件

@@ -2,7 +2,7 @@ import urllib2
import urllib
import urlparse

import datetime
import datetime, time
#import re

from BeautifulSoup import BeautifulSoup


Loading…
取消
儲存