Browse Source

Improve regex so it doesn't parse "Not Available" as a date (Lewisham)

Should we even bother parsing all these fields from the search results pages given that we'll get them on the deeper scrape anyway?
tags/v0.4.5
Adrian Short 6 years ago
parent
commit
ca5588706b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/uk_planning_scraper/idox.rb

+ 2
- 2
lib/uk_planning_scraper/idox.rb View File

@@ -74,11 +74,11 @@ module UKPlanningScraper
data[:council_reference] = matches[1] data[:council_reference] = matches[1]
end end


if matches = bit.match(/(Received|Registered):\s+(.+)/)
if matches = bit.match(/(Received|Registered):\s+.*(\d{2}\s\w{3}\s\d{2}\d{2}?)/)
data[:date_received] = Date.parse(matches[2]) data[:date_received] = Date.parse(matches[2])
end end
if matches = bit.match(/Validated:\s+(.+)/)
if matches = bit.match(/Validated:\s+.*(\d{2}\s\w{3}\s\d{2}\d{2}?)/)
data[:date_validated] = Date.parse(matches[1]) data[:date_validated] = Date.parse(matches[1])
end end




Loading…
Cancel
Save