#!/usr/local/bin/python3 require 'open-uri' require "pp" sio = OpenURI.open_uri("https://www.chintai.net/rent/") area = [] sio.each_line do |l| area << l.slice(%r|(https://www.chintai.net/rent/[a-z]+/ensen/)|, 1) end pp area