码迷,mamicode.com
首页 > Web开发 > 详细

htmlunit

时间:2017-06-08 23:49:17      阅读:487      评论:0      收藏:0      [点我收藏+]

标签:code   浏览器   unit   没有   技术分享   pen   soup   div   end   

htmlunit介绍

  htmlunit 是一款开源的java 页面分析工具,读取页面后,可以有效的使用htmlunit分析页面上的内容。项目可以模拟浏览器运行,被誉为java浏览器的开源实现。是一个没有界面的浏览器。
  Httpclient+jsoup无法解析js加载出来的页面数据,比如百度云用户页面,淘宝页面;
  htmlunit内嵌js浏览器,模拟Js运行,把结果执行出来,不过相对Httpclient+jsoup速度较慢。

导入依赖

  通过maven远程仓库导入htmlunit依赖包

  技术分享

<dependencies>
    <dependency>
        <groupId>net.sourceforge.htmlunit</groupId>
        <artifactId>htmlunit</artifactId>
        <version>2.26</version>
    </dependency>
</dependencies>

 

htmlunit

标签:code   浏览器   unit   没有   技术分享   pen   soup   div   end   

原文地址:http://www.cnblogs.com/ShawnYuki/p/6965183.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!