From: Luis Parravicini Date: 2009-01-30T00:51:46+09:00 Subject: Re: clicking links in mechanize with :text=> nokogiri.css('a.l') On Thu, Jan 29, 2009 at 8:11 AM, Edouard Dantes wrote: > i cannot click links in mechanize through their text content. > > i tried the following but get error with link_with(:text => '') method > or using the whole text content obtained through nokogiri parser method > css('a.l') that points to google results. > ... > @agent= WWW::Mechanize.new > @page=@agent.get('http://www.google.com/search?q=parsing') > > puts @agent.click @page.link_with(:text => 'parsing') <===?? There is no link with text 'parsing'. Just tried that google search and there's a 'Parsing' result on the first page. @page.link_with(:text => 'Parsing') returns a WWW::Mechanize::Page::Link -- Luis Parravicini http://ktulu.com.ar/blog/