From: tim.bounceback@... Date: 2007-04-05T05:05:07+09:00 Subject: Re: Simple problem w/ WWW::Mechanize On Apr 3, 1:36 am, Aaron Patterson wrote: > On Tue, Apr 03, 2007 at 08:50:04AM +0900, tim.bounceb...@gmail.com wrote: > > Thanks for replying. I still get a similar error, though: > > wikitesting.rb:8:in `get': undefined method `wpTextbox1' for > > nil:NilClass (NoMethodError) > > from wikitesting.rb:10 > > > Any ideas? By the way, I've joined the mailing list, and any future > > questions I might have will probably be directed there. > > It looks like Wikipidia may not like that parameter in the URL. When I > change 'Computer' to 'Main', it seems to work: > > require 'rubygems' > require 'mechanize' > > def get(pagename) > agent = WWW::Mechanize.new > agent.user_agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)' > page = agent.get('http://en.wikipedia.org/w/index.php?title='+ > pagename + '&action=edit') > > myform = page.form('editform') > return myform.wpTextbox1 > end > text = get('Main') > pp text > > -- > Aaron Pattersonhttp://tenderlovemaking.com/ OK, thanks, that seems to work! Tim