社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

安装Ghost.py on Linux

爱情的枪 • 10 年前 • 13500 次点击  

Ghosts是一个Python写的完全模拟浏览器的WebKit Client。

安装Ghost.py on Linux

第一步:安装PySide

sudo apt-get install cmake

Installing prerequisites

sudo apt-get install libqt4-dev   
sudo apt-get install qtmobility-dev
sudo apt-get install python2.7-dev
sudo apt-get install libphonon-dev

pip2.7 install wheel

Building PySide distribution

wget https://pypi.python.org/packages/source/P/PySide/PySide-1.2.2.tar.gz
tar -xvzf PySide-1.2.2.tar.gz
cd PySide-1.2.2
python setup.py bdist_wheel --qmake=/usr/bin/qmake-qt4

整个编译过程大概需要15-20分钟

Installing PySide distribution

$ ls dist
PySide-1.2.2-cp27-none-linux-x86_64.whl
$ sudo pip2.7 install dist/PySide-1.2.2-cp27-none-linux-x86_64.whl

pip-2.7 install --use-wheel dist/PySide-1.2.2-cp27-none-linux-x86_64.whl

python pyside_postinstall.py -install

第二步:安装Ghost

https://pypi.python.org/pypi/Ghost.py/0.1b3

下载 https://pypi.python.org/packages/source/G/Ghost.py/Ghost.py-0.1b3.tar.gz#md5=68e85f48a65c3369d538472a364cdaa1

然后 python setup.py install

遇到 的问题

如果遇到 以下错误:

not be used when making a shared object; recompile with -fPIC

则需要重新编译 Python

./configure --prefix=/home/work/usr/python/python2.7/ --with-ssl CFLAGS=-fPIC
make 
make install

如果遇到以下问题:

ValueError: ('Expected version spec in', 'dist/PySide-1.2.2-cp27-none-linux_x86_64.whl', 'at', '/PySide-1.2.2-cp27-none-linux_x86_64.whl')

则重新安装pip就行

参考

  • http://jeanphix.me/Ghost.py/
  • http://pyside.readthedocs.org/en/latest/building/linux.html
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/570
 
13500 次点击  
文章 [ 9 ]  |  最新文章 10 年前
Py站长
Reply   •   1 楼
Py站长    10 年前

@Django中国社区 上面这种方法运行有问题,请见: http://django-china.cn/topic/690/

Py站长
Reply   •   2 楼
Py站长    10 年前

我安装了 mac 版的

mac ghost 安装

pyside 安装 ##

http://pyside.readthedocs.org/en/latest/building/macosx.html

需要注意的是:你必须安装 xcode

安装差不多有 15~20 分钟 时间

安装完之后 会有 dist目录

然后

pip install dist/PySide-1.2.2-cp27-none-linux-x86_64.whl

python pyside_postinstall.py -install

安装 ghost

和linux的安装方式 一样

爱情的枪
Reply   •   3 楼
爱情的枪    10 年前

@olivetree 没玩过SpyNnner ,要不你介绍一下?

olivetree
Reply   •   4 楼
olivetree    10 年前

这个东西和Spynner 哪个好?

Py站长
Reply   •   5 楼
Py站长    10 年前

@olivetree 可以执行任何JS代码注入

olivetree
Reply   •   6 楼
olivetree    10 年前

@爱情的枪 在请求中加一些浏览器头就可以了吧,还有其它东西吗?

Py站长
Reply   •   7 楼
Py站长    10 年前

赞~

爱情的枪
Reply   •   8 楼
爱情的枪    10 年前

@olivetree 可以完全模拟浏览器来操纵网页哦

olivetree
Reply   •   9 楼
olivetree    10 年前

这个是用来开发浏览器的?