Browse Source

Fix new date format bug.

master
duncan.parkes 15 years ago
parent
commit
b1b5525e92
1 changed files with 5 additions and 6 deletions
  1. +5
    -6
      python_scrapers/Wychavon.py

+ 5
- 6
python_scrapers/Wychavon.py View File

@@ -65,13 +65,12 @@ RIPNAME=Root%2EPages%2EPgeDC%2EPgeListCases"
application.description = "" application.description = ""
else: else:
application.description = descrip.strip() 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 apptype = trs[0].findAll("td")[3].font.string
# Avoids throwing an error if no apptype is given (this can happen) # Avoids throwing an error if no apptype is given (this can happen)
if apptype != None: if apptype != None:


Loading…
Cancel
Save