Closed adrianshort closed 5 years ago
# Print the authority names that don't have received dates fields on their search form
require 'uk_planning_scraper'
auths = UKPlanningScraper::Authority.tagged('idox')
agent = Mechanize.new
auths.each do |auth|
begin
page = agent.get(auth.url)
next unless form = page.form('searchCriteriaForm')
puts auth.name unless form.has_field?('date(applicationReceivedStart)')
rescue StandardError
end
end
returns:
Hammersmith and Fulham
Newham
Manchester
Stockport
Bristol
Leeds
Sheffield
Bradford
Can we just check if the fields are present and add them if they're not?
raises: