From: Giles Bowkett Date: 2006-11-22T03:54:15+09:00 Subject: Re: mechanize question Hey, I don't know the answer to this question specifically, but I did some work with Mechanize recently and I found that it was pretty much doing everything we needed it to do, just sometimes returning things in forms we didn't expect. Pretty much everything we stumbled on, we solved by getting the return value and doing .class on it to find out what it was coming back to us as. Going on the million-dollar question, which I actually only just noticed, I think the HTML we were working against with Mechanize -- this was a consulting thing, so I don't have the code in front of me, it's on somebody else's laptop -- but I think the HTML was pretty bad. totally noncompliant, non-validating. we used Hpricot a lot, which is pretty great, we might have actually given up on Mechanize for the HTML-parsing and just used it for setting and getting cookies, things like that. I don't quite recall, but definitely have a look at Hpricot, it's pretty great and I think it was written by why the lucky stiff. On 11/21/06, Peter Szinek wrote: > Peter Szinek wrote: > > Hello, > > > > I am using mechanize 0.6.3. On Aaron's blog I have found this example: > > > > form.selectlist.options[2].select > > > > however, for me, 'puts form.methods.sort' revealed that form does not > > have a method 'selectlist'. What's up? I am doing something wrong? > > Meanwhile, after browsing the RDoc of WWW::Mechanize::GlobalForm I have > found that indeed, Form does not have a selectlist method. > > OK but then How I am supposed to get the selectlist of a form? > > the $1.000.000 question: In the same RDoc I read this: > > 'Class Form does not work in the case there is some invalid (unbalanced) > html involved...' > > Well, on my page, the
tag is not even closed. Can this be fixed > somehow? > > Thanks, > Peter > > __ > http://www.rubyrailways.com > > > -- Giles Bowkett http://www.gilesgoatboy.org