From 21853a7aa15e9069b2823d5fd60e43dd56833d81 Mon Sep 17 00:00:00 2001 From: "duncan.parkes@gmail.com" Date: Wed, 16 Sep 2009 19:10:50 +0000 Subject: [PATCH] Fix new date format bug. --- trunk/python_scrapers/Wychavon.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/trunk/python_scrapers/Wychavon.py b/trunk/python_scrapers/Wychavon.py index 43c7693..047239b 100644 --- a/trunk/python_scrapers/Wychavon.py +++ b/trunk/python_scrapers/Wychavon.py @@ -65,13 +65,12 @@ RIPNAME=Root%2EPages%2EPgeDC%2EPgeListCases" application.description = "" else: application.description = descrip.strip() - - rec_m, rec_d, rec_y = trs[1].findAll("td")[3].font.string.strip().\ - split("/") + + date_format = "%d/%m/%y" + date_string = trs[1].findAll("td")[3].font.string.strip() - application.date_received = datetime.date(int(rec_y), int(rec_m), \ - int(rec_d)) - + application.date_received = datetime.datetime.strptime(date_string, date_format) + apptype = trs[0].findAll("td")[3].font.string # Avoids throwing an error if no apptype is given (this can happen) if apptype != None: