From: Josh Cheek Date: 2011-09-09T23:24:28+09:00 Subject: Re: Submitting a URL with Mechanize --20cf307d028045b54d04ac82ef66 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 9, 2011 at 5:38 AM, dwight schrute wrote: > Hi, > > I have a function called showURL, which prints out a URL when I do this: > > puts master.showURL > > Where master is an instance of the class URL, which I have previously > defined. showURL is a method defined in the URL class. > > I am using Mechanize to get URLS, like this: > > agent = Mechanize.new > > and I want to try an submit the URL I have created, something like this: > > agent.get(puts master.showURL) > > This doesn't seem to work. > > Can anyone give me a hand? > > Many thanks in advance. > > Dwight > > -- > Posted via http://www.ruby-forum.com/. > > puts sends the url to standard output. That isn't what you want, you want to pass it to agent.get agent.get(master.showURL) --20cf307d028045b54d04ac82ef66--