美文网首页
如何安装Splinter for Mac

如何安装Splinter for Mac

作者: 冰城已无爱 | 来源:发表于2018-02-01 10:57 被阅读0次

今天正好从网上看到了一个大神写的抢票的工具,我就萌生了安装这个Spointer工具的想法。

首先因为我是Mac机,直接使用了命令行,在终端输入python 查看自己的photon 的版本号,

Python 2.7.10 (default, Jul 15 2017, 17:16:57)

这个python是基础,然后,安装Splinter ,

安装地址:https://pypi.python.org/pypi/splinter#downloads

下载gz格式

下载完成后,打开命令行安装

python /Users/mayinxue/Desktop/setup.py install

很尴尬,提示:No such file or directory: ‘README.rst'

所以,你可以这样操作:

cd  /Users/mayinxue/Desktop/splinter-0.7.7 

python setup.py install

苦逼又提示了一句:Please make the appropriate changes for your system and try again.

所以。我终极大招来了:

 sudo  python setup.py install

安装成功。

接下来,我们就可以进入试一试,不过前提你的浏览器有谷歌或者火狐,否则你输入

python 

>>> from splinter.browser import Browser

>>>b = Browser()

提示:

因此可以下载谷歌安装Chromedriver 

然后试一下是否成功

python

>>>from splinter.browser  import Browser

>>> b = Browser("chrome") //打开chrome浏览器

>>>b.visit("https://kyfw.12306.cn/otn/login/init") //12306 登陆URL

完美~~~~~~

相关文章

网友评论

      本文标题:如何安装Splinter for Mac

      本文链接:https://www.haomeiwen.com/subject/saarzxtx.html