0
的頁面,在特定頁面HTML contect從我的方法來讀取從頁面不同
我的方法
public String getHtml(String urlStr, String charset) throws Exception {
System.setProperty("http.proxyHost", "XXX.XX.X.XXX");
System.setProperty("http.proxyPort", "XXXX");
URL url = new URL(urlStr);
URLConnection conn = url.openConnection();
InputStream is = url.openStream();
InputStreamReader isr = new InputStreamReader(is, charset);
BufferedReader br = new BufferedReader(isr);
String linha = br.readLine();
String html = "";
while (linha != null) {
System.out.println("" + linha);
html += linha;
linha = br.readLine();
}
return html;
}
這種方法會奏效到其他頁面,但給我一個不完整的HTML。
我看到了大量的JavaScript通過該頁面,但我不知道它是否具有影響力
下面是HTML返回從這個頁面
<!doctype html>
<html>
<head>
<title>Centerplex Cinemas</title>
<meta charset="iso-8859-1">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<link href="apple-touch-icon.png" rel="apple-touch-icon" type="image/png">
<link href="lib/css/estilo.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="tematizacao">
<iframe src="//www.youtube.com/embed/" class="trailer" frameborder="0" allowfullscreen></iframe>
<img src="http://www.centerplex.com.br/fotos/wallpaper_mobile/470.jpg" />
</div>
<div class="header">
<h1><a href="index.php" title="Centerplex">Centerplex</a></h1>
</div> <div class="efilme">
<a href="http://www.centerplex.com.br/mobile/filme.php?cf=5807" title="Kung Fu Panda 3"><img src="http://www.centerplex.com.br/fotos/hp_mobile/188.jpg" title="Kung Fu Panda 3" alt="Kung Fu Panda 3" width="100%"></a>
</div>
<ul class="nav">
<li><a href="lancamentos.php" title="Estreias/Em Cartaz">Estreias/Em Cartaz</a></li>
<li><a href="salas-horarios.php" title="Salas & Horários">Salas & Horários</a></li>
</ul>
<ul class="fnav">
<li><a href="breve.php" title="Em Breve" class="breve">Em Breve</a></li>
<li><a href="promocoes.php" title="Promoções" class="promo">Promoções</a></li>
<li><a href="corporativo.php" title="Corporativo" class="corp">Corporativo</a></li>
<li class="nbr"><a href="faleconosco.php" title="Fale Conosco" class="fale">Fale Conosco</a></li>
</ul> <div class="footer">
<p>©Centerplex 2016</p>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3269539-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>