Closed sunng87 closed 3 weeks ago
I think it'd have to be opt-in optional. Like Connection.followMetaRedirects(true)
It does not work for http://baidu.com
either. The HTML I got is:
<html>
<head>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</head>
<body>
</body>
</html>
I used Connection.followRedirects(true)
in version 1.8.3.
Closing, no plan to implement.
We just got this kind of redirection when parsing html files. Some web sites doesn't use standard HTTP redirection. Instead, they use browser redirection:
We can check the Refresh meta tag: If the content URL doesn't equal to base URL, just treat it as a redirection. This can be done within HTTPConnection. I found a python command line utility httpie supports this feature. It will be nice to have this feature in Jsoup.