爬虫学习-phantomjs
来源:互联网 发布:plc编程 工资高吗 编辑:程序博客网 时间:2024/06/05 06:30
下载phantomjs
java调用phantomjs
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;public class PhantomJsUtil {private static String phantomExePath = "D:/软件备份/测试/phantomjs-2.1.1-windows/phantomjs-2.1.1-windows/bin/phantomjs.exe";private static String phantomJsPath = "D:/软件备份/测试/phantomjs-2.1.1-windows/phantomjs-2.1.1-windows/examples/hello.js";public static String getCotnent(String url) throws IOException {Runtime rt = Runtime.getRuntime();// 获取运行时状态Process p = rt.exec(phantomExePath+" "+phantomJsPath);// 加载phantomjsInputStream is = p.getInputStream();BufferedReader br = new BufferedReader(new InputStreamReader(is));StringBuffer sbf = new StringBuffer();String tmp = "";//读取phantomJs的执行结果while ((tmp = br.readLine()) != null) {sbf.append(tmp);}System.out.println(sbf.toString());return sbf.toString();}public static void main(String[] args) throws IOException {getCotnent("");}}
阅读全文
0 0
- 爬虫学习-phantomjs
- 爬虫学习笔记--Selenium PhantomJS
- [笔记] PhantomJS爬虫小记
- 爬虫利器:Selenium+PhantomJS
- phantomjs+selenium+python爬虫
- 爬虫工具:PhantomJS
- 爬虫利器之PhantomJS
- 爬虫-08-selenium & phantomjs
- Scrapy+PhantomJS+Selenium动态爬虫
- Scrapy+PhantomJS+Selenium动态爬虫
- Scrapy+PhantomJS+Selenium动态爬虫
- Selenium+Chrome(PhantomJs) Python爬虫
- python网络爬虫学习(六)利用Pyspider+Phantomjs爬取淘宝模特图片
- phantomjs学习笔记
- 学习PhantomJS笔记
- python selenium phantomjs学习
- python+pyspider+phantomjs实现简易爬虫功能
- Python 爬虫 PhantomJs 获取JS动态数据
- Binder机制
- LRU缓存算法
- Bitmap的分析与使用
- Mac 系统上安装Lua和SubmlimeText 编译器
- meanshift
- 爬虫学习-phantomjs
- 通过反射动态类方法
- 非常好的动态规划总结,DP总结
- java基础-equals和==
- 移动端监听手机键盘弹起和关闭(Ionic+Cordova)
- Ubuntu 16.04下安装vsftp
- 机器学习19-SVM线性可分公式推导(一)
- EventBus用法详解
- oracle中分组排序函数