最小化浏览器程序 KPBroswer

码农软件 · 软件分类 · 网络工具包 · 2019-02-27 20:59:38

软件介绍

KPBroswer是一个基于QtWebKit的最小化浏览器程序,通过被第三方程序调用,
能实现对复杂页面加载后数据(例如,复杂Ajax、数据加密)的抓取,支持屏幕截图。
KP是“鲲鹏”二字的拼音首字母。

适用场景:

 页面数据动态加载(例如,Ajax过程过于复杂,分析成本太高);
 数据加密(客户端JS解密,解密算法难以获取或难以用其它语言实现);
 屏幕截图;
 跨平台的抓取方案;


依赖库:

PyQt4
Ubuntu下安装方法:sudo apt-get install python-qt4
Windows下安装方法:在这里下载二进制安装包直接安装http://www.riverbankcomputing.co.uk/software/pyqt/download/

调用方法:

若在Linux终端下运行,需要安装Xvfb。Ubuntu下安装方法:apt-get install xvfb xfonts-base xfonts-75dpi xfonts-100dpi xfonts-wqy
调用举例(Linux):xvfb-run python KPBroswer.py http://www.site-digger.com --flags=redice --output="page.html" --screenshot="sitedigger.jpg"
调用举例(Windows):python KPBroswer.py http://www.site-digger.com --flags=redice --output="page.html" --screenshot="sitedigger.jpg"

Usage: KPBroswer.py  [options]

Options:
  -h, --help            show this help message and exit
  -p PROXY, --proxy=PROXY
                        Proxy to use.
  -t TIMEOUT, --timeout=TIMEOUT
                        The timeout time of loading page.
  -f FLAGS, --flags=FLAGS
                        Flags need to wait for. Semicolon can be used as a
                        eperator.
  -w WAIT_TIMEOUT, --wait_timeout=WAIT_TIMEOUT
                        The timeout time of waitting for flags.
  -g, --gui             Whether to show the broswer GUI.
  -o OUTPUT, --output=OUTPUT
                        The output filename.
  -s SCREENSHOT, --screenshot=SCREENSHOT
                        If the value is not empty, take a screenshot and save
                        it here.

注意:
Linux下不要忘记安装相关字体库,否则截图中的汉字将会是乱码,如下图site-digger-font-problem.jpg所示。

安装后,就正常了,如图site-digger.jpg所示。

示例:
sample.py文件为一个Python以外部程序方式调用KPBroswer.py的示例,其它语言的调用可以参考其实现。

本文地址:https://codercto.com/soft/d/276.html

Geometric Folding Algorithms

Geometric Folding Algorithms

Erik D Demaine / Cambridge University Press / 2008-8-21 / GBP 35.99

Did you know that any straight-line drawing on paper can be folded so that the complete drawing can be cut out with one straight scissors cut? That there is a planar linkage that can trace out any alg......一起来看看 《Geometric Folding Algorithms》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换