[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Mechanize gem -- help

Raveendran Jazzez

4/4/2009 11:29:00 AM

Hi All,

Code:

require 'mechanize'
@agent = WWW::Mechanize.new
source=@agent.get("http://yahoo....)
puts source # => It gives Source code.

NEED:

I entered "http://yahoo.... this url in browser , but its goes to
"http://in.yahoo.com/?....

I want to get the redirected url. Is there any possibility to get that
redirected link ?

Expected Example:
require 'mechanize'
@agent = WWW::Mechanize.new
source=@agent.get("http://yahoo....)
puts X=source.GET_REDIRECTED_URL #=> http://in.yahoo...


Thanks in Advance,
P.Raveendran
http://raveendran.wor...
--
Posted via http://www.ruby-....

1 Answer

Raveendran Jazzez

4/6/2009 4:05:00 AM

0

Hi All,

I tried

require 'mechanize'
@agent = WWW::Mechanize.new
source=@agent.get("http://yahoo....)
puts source.uri #=> http://...

BUT I Expect like


puts X=source.GET_REDIRECTED_URL #=> http://in.yahoo...
--
Posted via http://www.ruby-....