Redirected URL

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.

Anil K. 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

  1. examining a response’s Location header

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

Thanks,
Anil.

7stud – wrote:

Anil K. 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

  1. examining a response’s Location header

URL redirection - Wikipedia