From: Wiley Davis Date: 2009-10-11T00:46:26+09:00 Subject: Can't use variable from cgi with hpricot I'm trying to get a url from a form and return the page title of said url. I'm using cgi to get the web address from the url, which looks like this: http://somesite.com/result.rhtml?link=http%3A%2F%2Fpracticalpedal.com The result page embedded ruby looks like this: <% require 'rubygems' require 'cgi' require 'open-uri' require 'hpricot' cgi = CGI.new @linky = cgi['link'].to_str @result = open(@linky) @doc = Hpricot(@result) @title = (@doc/"title").inner_html @result.close puts @title %> This works if I assign the @linky variable like so: @linky = "http://practicalpedal.com" But not when getting it with cgi. I'm very new at all of this, as is probably obvious, but I can't figure this out. Any pointers in the right direction would be appreciated. -- Posted via http://www.ruby-forum.com/.