警告是:2012-2-16 18:17:04 org.apache.commons.httpclient.HttpMethodBase getResponseBody
警告: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
Parser cannot be resolved to a type
Parser cannot be resolved to a type
NodeFilter cannot be resolved to a type
NodeFilter cannot be resolved to a type
Node cannot be resolved to a type
OrFilter cannot be resolved to a type
OrFilter cannot be resolved to a type
NodeClassFilter cannot be resolved to a type
LinkTag cannot be resolved to a type
NodeList cannot be resolved to a type
Node cannot be resolved to a type
LinkTag cannot be resolved to a type
LinkTag cannot be resolved to a type
LinkTag cannot be resolved to a type
ParserException cannot be resolved to a type at HtmlParserTool.extracLinks(HtmlParserTool.java:21)
at MyCrawler.crawling(MyCrawler.java:47)
at MyCrawler.main(MyCrawler.java:59)用到了httmclient和 httpparser两个开源包
这问题这么解决?
源码在这里:http://blog.csdn.net/chago_/article/details/7265664

解决方案 »

  1.   

    警告是推荐使用getResponseBodyAsStream来替换getResponseBody
    不过最主要是查明为什么有那么多类型不能识别
      

  2.   

    抛ParserException ?抛了一样警告
      

  3.   

    at HtmlParserTool.extracLinks(HtmlParserTool.java:21)
    at MyCrawler.crawling(MyCrawler.java:47)
      

  4.   

    粗略一看,貌似是你这些jar包没配置好。你那个DownLoadFile的getFileNameByUrl方法中的urlurl定义了没?开源包都不知道啥版本,没法帮你调试。最好把整个项目打个包。
      

  5.   

    博文已指明导入的包,url参数来的吧
      

  6.   

    HtmlParser包括htmlparser.jar、htmllexer.jar以及filterbuilder.jar等API文件,至少得在项目中导入htmlparser.jar、htmllexer.jar。
    使用 HttpClient 和 HtmlParser 实现简易爬虫
      

  7.   

    Htmllexer.jar导入后,一样结果,jar包齐全的啦