Redirected URL

Discussion in 'Ruby' started by Anil Kumar, Aug 21, 2009.

  1. Anil Kumar

    Anil Kumar Guest

    Hi,
    I was trying to parse a web page where multiple hyper links exist.
    Each hyper link redirecting to a different server. I just want store
    first server it is redirecting the request too.

    I tried using 'net/http' to capture 'Location' from response. But not
    working. Showing 'Location' value as blank.

    Please help.
    Thanks,
    Anil.
    --
    Posted via http://www.ruby-forum.com/.
    Anil Kumar, Aug 21, 2009
    #1
    1. Advertising

  2. Anil Kumar

    7stud -- Guest

    Anil Kumar wrote:
    > Hi,
    > I was trying to parse a web page where multiple hyper links exist.
    > Each hyper link redirecting to a different server. I just want store
    > first server it is redirecting the request too.
    >
    > I tried using 'net/http' to capture 'Location' from response. But not
    > working. Showing 'Location' value as blank.
    >


    Do you know the difference between:

    1) parsing a web page and retrieving the first link's href

    and

    2) examining a response's Location header

    http://en.wikipedia.org/wiki/URL_redirection
    --
    Posted via http://www.ruby-forum.com/.
    7stud --, Aug 22, 2009
    #2
    1. Advertising

  3. Anil Kumar

    Anil Kumar Guest

    Thanks for you reply. I know the difference. I resolved this issue by
    sending 'User-Agent' value in header.

    Thanks,
    Anil.

    7stud -- wrote:
    > Anil Kumar wrote:
    >> Hi,
    >> I was trying to parse a web page where multiple hyper links exist.
    >> Each hyper link redirecting to a different server. I just want store
    >> first server it is redirecting the request too.
    >>
    >> I tried using 'net/http' to capture 'Location' from response. But not
    >> working. Showing 'Location' value as blank.
    >>

    >
    > Do you know the difference between:
    >
    > 1) parsing a web page and retrieving the first link's href
    >
    > and
    >
    > 2) examining a response's Location header
    >
    > http://en.wikipedia.org/wiki/URL_redirection


    --
    Posted via http://www.ruby-forum.com/.
    Anil Kumar, Aug 22, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kaidi
    Replies:
    3
    Views:
    1,353
    Kaidi
    Jan 4, 2004
  2. Muggle

    Finding the Redirected URL

    Muggle, Aug 26, 2008, in forum: Java
    Replies:
    1
    Views:
    3,865
    Stefan Ram
    Aug 26, 2008
  3. Roedy Green
    Replies:
    4
    Views:
    876
    Roedy Green
    Nov 17, 2010
  4. akanksha

    mechnize redirected url

    akanksha, Aug 4, 2006, in forum: Ruby
    Replies:
    1
    Views:
    100
    Alex Young
    Aug 4, 2006
  5. Replies:
    2
    Views:
    131
Loading...

Share This Page