我正在使用Jsoup來解析網站。我在解析類:Jsoup沒有檢測到引號中的文本
<td class="tl">
<script> document.write(Icons.GetShortDescription(1, 'CurrentWeather'));</script>
"Despejado"<span class="details">
</span>
</td>
Jsoup無法檢測到文本「Despejado」。下面是相關的代碼:
url="http://freemeteo.ar.com/eltiempo/mendoza/historia/historial-diario/?gid=3844421&date=2010-07-02&station=23812&language=spanishar&country=argentina";
doc = Jsoup.connect(url).get();
i=0;
Elements lineks = doc.select("table.daily-history");
for (Element linek : lineks) {
Elements datos=linek.select("tbody");
for(Element dato : datos){
Elements datos5 = dato.select("td.tl");
System.out.println("code class:" + datos5.html());
}
}
輸出是: 「despejado」
code class: <script>
document.write(Icons.GetShortDescription(1, 'CurrentWeather'));
</script><span class="details"> </span>
Jsoup不讀問題是什麼?
- bug Jsoup?
- 問題是網站?
請幫助我瞭解如何讀課文 「despejado」?**
很好!!!!感謝您的幫助,非常巧妙的解決方案。 – user3588102
Pd:你是天才;) – user3588102
沒問題。如果確實有效,那麼可以隨時接受答案。 – Everett