How do you grab the source HTML from a url?

I want to grab all of the list of users from my app and make a nice
formatted list of them every week, and I was wondering what rails
command would grab the source html from a url?

Thanks,
Ben L.

Ben L. wrote:

I want to grab all of the list of users from my app and make a nice
formatted list of them every week, and I was wondering what rails
command would grab the source html from a url?

Thanks,
Ben L.

Well, I could just have the app write it directly to a file, but for
curiosity sake, how would it be done?

On Monday, July 31, 2006, at 5:16 AM, Ben L. wrote:


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

require ‘open-uri’

lines=[]
open(‘http://url/to/parse’) do |f|
lines = f.readlines
end

That should dump the entire thing into an array.
There are some libraries to help you parse that mess, but it’s late and
I don’t remember which ones they are.

_Kevin
www.sciwerks.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs