我需要從特定行讀取URL html頁面中的行。閱讀url數據特定行java
現在,我有以下代碼:
u = new URL("http://s.ll/message/" + counter);
is = u.openStream(); // throws an IOException
dis = new DataInputStream(new BufferedInputStream(is));
while ((s = dis.readLine()) != null) {
if (s.contains('%')
...
}
我知道這個內容會不會是50前行。
我該如何閱讀這一行?
這是讀取網址最快的方法嗎?
+1 for mojibake! – systempuntoout 2010-11-20 22:51:01