adrianshort / uk_planning_scraper

A Ruby gem to get planning applications data from UK council websites.
GNU Lesser General Public License v3.0
27 stars 19 forks source link

case_officer_code modifies Authority url param #41

Open adrianshort opened 3 years ago

adrianshort commented 3 years ago

How to reproduce:

auth = UKPlanningScraper::Authority.named("X") # Northgate authorities only
apps1 = auth.case_officer_code("123").decided_days(7).scrape
apps2 = auth.decided_days(7).scrape

This fails because the url param of Authority has been modified so the apps2 call to scrape fails because it's trying to scrape from the case officer page rather than the general search page.

The url param needs to stay constant throughout the lifetime of the object so scrape will always be requesting the right URL.