当前位置: 技术问答>java相关
急问java中有关HTML解析器的使用
来源: 互联网 发布时间:2015-07-03
本文导语: 我在运行java 解析器对HTML分析时遇到如下代码不能通过: public static void main (String[] args){ ParserGetter kit=new ParserGetter(); HTMLEditorKit.Parser parser=kit.getParser(); try{ URL u=new URL(/tech-qa-java/args[0]/index.html); In...
我在运行java 解析器对HTML分析时遇到如下代码不能通过:
public static void main (String[] args){
ParserGetter kit=new ParserGetter();
HTMLEditorKit.Parser parser=kit.getParser();
try{
URL u=new URL(/tech-qa-java/args[0]/index.html);
InputStream in=u.openStream();
InputStreamReader r=new InputStreamReader(in);
HTMLEditorKit.ParserCallback callback=new Outliner(new OutputStreamWriter(System.out));
parser.parser(r,callback,false);
}
不知道原因何在,请大虾指点,先谢了
public static void main (String[] args){
ParserGetter kit=new ParserGetter();
HTMLEditorKit.Parser parser=kit.getParser();
try{
URL u=new URL(/tech-qa-java/args[0]/index.html);
InputStream in=u.openStream();
InputStreamReader r=new InputStreamReader(in);
HTMLEditorKit.ParserCallback callback=new Outliner(new OutputStreamWriter(System.out));
parser.parser(r,callback,false);
}
不知道原因何在,请大虾指点,先谢了
|
it is from
Java Network Programming, Second Edition
Elliotte Rusty Harold
http://www.ibiblio.org/javafaq/slides/sd2000east/webclient/Web_Client_Programming_with_Java.html
get the source code from
http://examples.oreilly.com/javanp2/examples.zip
Java Network Programming, Second Edition
Elliotte Rusty Harold
http://www.ibiblio.org/javafaq/slides/sd2000east/webclient/Web_Client_Programming_with_Java.html
get the source code from
http://examples.oreilly.com/javanp2/examples.zip