From: Peter Szinek Date: 2006-11-20T01:43:35+09:00 Subject: Re: Ruby screen scraping Chris Gallagher wrote: > Hi, > > I'm looking at creating a ruby script that will firstly access our > cruise control page on localhost and examin the page to see the values > on the page, so basically telling us if the build succeeded or failed. Once you have the page (open-uri if you know the URL exactly, or www::mechanize if you need to navigate there (i.e. fill textfields, click buttons etc)) I recommend to check out these possibilities: 1) regular expressions 2) HPpricot 3) scrAPI 4) Rubyful soup Regular expressions would be the most old-school solution, in some cases such a wrapper is the most robust (but since you are in control of the generated page as I understood, robustness is possibly not an issue). If you can't do it with regexps, HPricot will be most probably adequate (I would need to see the concrete page). Finally, if neither of the above works, you should try scrAPI - and though I don't think so you should fail after this point, Rubyful soup is another possibility to check out. Peter __ http://www.rubyrailways.com