Jsoup 方法:

	     String url="http://";
		try {
			//true = 跟随redirects跳转 ; false = 不跟随跳转
			Document doc = Jsoup.connect(url).timeout(120000).followRedirects(true).execute().parse();
			System.out.println(doc.baseUri());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

 问题在于如果首次访问对链接,如果跳转的url仍然有跳转,就无法在这种请求方式中解决。

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2021-06-20
  • 2022-12-23
  • 2021-12-29
  • 2021-12-18
相关资源
相似解决方案