From d6ff621eace0292f0f3146c4a1d660d0fcda100e Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 24 Apr 2019 08:19:54 +0100 Subject: [PATCH] Limit number of properties retrieved per application --- lib/uk_planning_scraper/idox.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/uk_planning_scraper/idox.rb b/lib/uk_planning_scraper/idox.rb index 878a546..333da14 100644 --- a/lib/uk_planning_scraper/idox.rb +++ b/lib/uk_planning_scraper/idox.rb @@ -213,7 +213,9 @@ module UKPlanningScraper app.property_detail_urls = [] get(app.property_url) do |res| - res.search('#Property li a').each do |property_link| + res.search('#Property li a').each_with_index do |property_link, index| + break if index >= 10 + app.property_detail_urls << base_url + property_link[:href] end end