查看: 879|回复: 3
|
怎样才能从网站拿该网站的HTML code?
[复制链接]
|
|
想问问各位programming高手。小弟现在develop一个system,(website usability evaluation system)
我想从java coding中user key in的该网站拿取HTML code,那个coding是要怎样下手呢?
还是各位高手有什么建议与小弟分享的?或许有个网站供我参考也可以.
感谢各位啦... |
|
|
|
|
|
|
|

楼主 |
发表于 1-5-2007 06:45 PM
|
显示全部楼层
难道没人会吗?啊。。。。
我要死了。。做不到啊~~卡在这很鬼久了。。 |
|
|
|
|
|
|
|
发表于 1-5-2007 07:19 PM
|
显示全部楼层
http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
import java.net.*;
import java.io.*;
public class URLConnectionReader {
public static void main(String[] args) throws Exception {
URL yahoo = new URL("http://www.yahoo.com/") ;
URLConnection yc = yahoo.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
[ 本帖最后由 hkloke2000 于 1-5-2007 07:21 PM 编辑 ] |
|
|
|
|
|
|
|

楼主 |
发表于 4-5-2007 04:09 PM
|
显示全部楼层
感谢这位仁兄的帮忙。。
大恩永记于心。现在试试这coding |
|
|
|
|
|
|
| |
本周最热论坛帖子
|