0

I'm trying to get the html document out of the following URL: http://search.lib.monash.edu/primo_library/libweb/action/search.do?vl%28freeText0%29=java&vid=MON&fn=search

The problem is that I'm getting 302 response code! I'm not familiar with the way this request is being handled here (given the function and the parameters) so not really what the appropriate way to read this html is, would appreciate any help to read the html.

Thanks

  • 1
    Why is 302 response a problem? This just means the resource requested at the original URL was found, and you were redirected to it. – Mike Brant Mar 15 '14 at 00:05
  • 1
    302 is a soft redirect. That is not the final page you land on if you browse to that URL. Wikipedia maintains a [list of HTTP Status codes](https://en.m.wikipedia.org/wiki/List_of_http_codes) and what they mean. – Two-Bit Alchemist Mar 15 '14 at 00:06

1 Answers1

0

A 302 redirect is notice to the browsing client that the document has been moved, it won't necessarily give you the content unless your browsing client follows the redirect. Try using cURL with the -L argument to have it follow the redirect. Try this

curl -vv -L http://......
MikeB
  • 577
  • 5
  • 15
  • Thanks for your answer! Now I'm getting the redirect url from the header but I'm then getting sso file instead of the page I wanted even though it is publicly accessible.. Any idea how to get the original page as it is?! – user3421917 Mar 15 '14 at 10:28
  • Hi, without knowing what you were expecting to see at that URL, it's a little hard to say.If it expects a valid session for you to get at the page you want, you will need to authenticate to the URL first - I'm saying this on having no knowledge of the service. There are many methods of using cURL (for example) to authenticate, but it depends on the type of auth being used. Are you trying to get to this using a browser or other client? – MikeB Mar 16 '14 at 21:44