Browse Source

Limit number of properties retrieved per application

pull/38/head
Graeme Porteous 5 years ago
parent
commit
d6ff621eac
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      lib/uk_planning_scraper/idox.rb

+ 3
- 1
lib/uk_planning_scraper/idox.rb View File

@@ -213,7 +213,9 @@ module UKPlanningScraper
app.property_detail_urls = [] app.property_detail_urls = []


get(app.property_url) do |res| 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] app.property_detail_urls << base_url + property_link[:href]
end end
end end


Loading…
Cancel
Save