Dan Kohn wrote:
> Thanks for the response, James. My next question was actually about
> debugging Mechanize
> <http://groups.google.com/group/comp.lang.ruby/msg/04fc7473b08c16fc>.
> Would you mind emailing me your scraping code, as I've been suffering
> from a lack of examples to copy?
>
> Also, are you sure Mechanize parses the whole page with get? It
> doesn't wait for a find?
Don't think so, but I might be wrong. My code calls agent get, then
goes right into looping over the collected nodes.
I'll see about putting my code together as an example.
As for debugging Mechanize, I've found it helpful to go to the lib
source and stick in some STDERR.puts calls to inspect request and
response data to be sure things are getting passed around as expected.
After that, unit tests are helpful.
James
--
http://www.ruby-doc.org - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys
http://www.30secondrule.com - Building Better Tools