A Ruby library offering both a CLI and API for scraping Extra Space self-storage facilities and prices.
gem install extraspace
require 'extraspace'
ExtraSpace.configure do |config|
config.user_agent = '../..' # ENV['EXTRASPACE_USER_AGENT']
config.timeout = 30 # ENV['EXTRASPACE_TIMEOUT']
end
require 'extraspace'
sitemap = ExtraSpace::Facility.sitemap
sitemap.links.each do |link|
url = link.loc
facility = ExtraSpace::Facility.fetch(url:)
puts facility.text
facility.prices.each do |price|
puts price.text
end
puts
end
extraspace crawl
extraspace crawl "https://www.extraspace.com/storage/facilities/us/california/los_angeles/900113/"