From: Cliff Cyphers Date: 2006-08-02T23:46:38+09:00 Subject: Re: super-newbee Ruby regex help? Aaron Reimann wrote: > I had to install the 'mechanize' gem, but it works...overall. I have > to figure out how to "write" the output into a text file. but this is > pretty cool. > Update filename and you are set. url="http://edge.i-hacked.com/250-working-proxies-for-safe-web-access-from-work-or-school" filename="/tmp/tmp2.txt" agent = WWW::Mechanize.new page = agent.get(url) session_fd = File.open(filename, "w") page.body.scan(/http:\/\/www\.([^"]+)/) do session_fd.puts $1 end session_fd.close