微信
手机版
网站地图

激光近视,妖狐-盛誉下的侧面,聚光灯下的国产交互式电影游戏

2019-07-15 14:42:04 投稿人 : admin 围观 : 195 次 0 评论

环境:Linux(ubuntu18.04):

一、装置python

在Ubuntu18.04下是主动装置python的。如图:

二、装置python–requests库

requests库的效果是什么呢?他的效果便是模仿浏览器向服务器发送恳求。

同上requests库也是自带的。可是咱们在运用requests却呈现了这种状况,如下:

gxa@gxa-virtual-machine:~$ python3

Python 3.6.8 (default, Jan 14 2019, 11:02:34)

[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import requests

/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.25.3) or chardet (3.0.4) doesn't match a supported version!

RequestsDependencyWarning)

gxa@gxa-virtual-machine:~$ 激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright来操", "credits" or "license" for more information.
>>> import requests
/usr/lib/python3/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.25.3) or chardet (3.0.4) doesn't match a supported ve激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏rsion!
RequestsDependencyWarning)

什么意思呢?

便是说:python库中urllib3 (1.24.1) or chardet (3.0.4) 的版别不兼容。所以咱们履行一下指令:

~$pip uninstall urllib3
~$pip uninstall chardet

呈现如下咱们能够看到装置成功:

gxa@gxa-virtual-machine:~$ pipca45293 uninstall urllib3
Uninstalling urllib3-1.25.3:
/home/gxa/.local/lib/python3.6/site-packages/urllib3-1.25.3.dist-info/INSTALLER
/home/gxa/.local/lib/python3.6/site-packages/urllib3-1.25.3.dist-info/LICENSE.txt
/home/gxa/.local/lib/python3.6/site-packages/urllib3-1.25.3.dist-info/METADATA
/home/gxa/.local/lib/python3.6/site-packages/urllib3-1.25.3.dist-info/RECORD
/home/gxa/.local/lib/python3.6/site-packages/urllib3-1.25.3.dist-info/WHEEL
/home/gxa/.local/lib/python3.6/site-packages/urllib3-1.25.3.dist-info/top_level.txt
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__init__.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/__init__.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/_col激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏lections.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/connection.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/connectionpool.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/exceptions.cpython-36.py女男人c
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/fields.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/filepost.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/poolmanager.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/request.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/__pycache__/response.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/_collections.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/connection.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/connectionpool.py
/home/gxa/.local/lib/python3.6/site-p利剑搏斗英豪连ackages/urllib3/contrib/__init__.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/__init__.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/_appengine_environ.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/appengine.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/ntlmpool.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/pyopenssl.cpython-36.pyc
/home/gxa锁情环/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/securetransport.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/__pycache__/socks.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_appengine_environ.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_securetransport/__init__.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_securetransport/__pycache激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏__/__init__.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_securetransport/bindings.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/_securetransport/low_level.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/appengine.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/ntlmpool.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/contrib/securetransport.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3militantly/contrib/socks.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/exceptions.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/fields.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/filepost.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/__init__.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/__pycache__/__init__.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/__pycache__/six.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/backports/__init__.py
/hom是树木游水的力气e/gxa/.local/lib/python3.6/site-packages/urllib3/packages/backports/__pycache__/__init__.cpython-36.pyc
/home/gxa/.loca雍正后宫l/lib/python3.6/site-packages/urllib3/packages/backports/__pycache__/makefile.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/backports/makefile.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__init__.py
/home/gxa/.local/lib/python3.6/si激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏te-packages/urllib3/packages/rfc3986/__pycache__/__init__.cpython-36.pycqq麻将作弊器
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/_mixin.cpython-36.pyc
/home/gxa/.local/lib/pythonbydfo最新报价3.6/site-packages/urllib3/packages/rfc3986/__pycache__/abnf_regexp.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/api.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/builder.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/compat.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/exceptions.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/iri.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/misc.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/normalizers.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/parseresult.cpython-36.pyc
/home/激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/uri.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/__pycache__/validators.cpython-36.pyc
/h安娜金斯卡娅ome/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/_mixin.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/abnf_regexp.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/api.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/builder.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/compat.py
/home/gxa/.local/humpinglib/python3.6/site-packages/urllib3/packages/rfc3986/exceptions.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/iri.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/misc.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/normalizers.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/parseresult.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/uri.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/rfc3986/validators.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/six.py
/迷仙镇案home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/ssl_match_hostname/__init__.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/p爆料李钟硕私生活ackages/ssl_match_hostname/_implementation.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/poolmanager.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/request.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/response.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__init__.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/__init__.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/connection.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/queue.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/request.cpython-36.pyc
/home/gxa/.local/lib/p美人聊天室ython3.6/site-p孔令辉和马苏的女儿ackages/urllib3/util/__pycache__/response.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/retry.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__py初中校花cache__/ssl_.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/timeout.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/url.cpython-36.pyc
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/__pycache__/wait.cpython-36.py激光近视,妖狐-盛誉下的旁边面,聚光灯下的国产交互式电影游戏c
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/connection.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/queue.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/request.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/response.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/retry.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/timeout.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/url.py
/home/gxa/.local/lib/python3.6/site-packages/urllib3/util/wait.py
Proceed (y/n)? y
Successfully uninstalled urllib3-1.25.3 //这是要点奥。

假如没有requests库的话,咱们能够运用以下指令:

pip install requests

关于pip这个指令,咱们稍后介绍以下。

三、接下来咱们就装置selenium库啦。

这个库的效果是什么呢?他是一个主动化测验东西,利用它咱们能够驱动浏览器履行特定的动作,比方点击、下拉等操作。相同咱们装置此库,也需求用到以下指令:

pip3 install selenium

可是呢咱们在履行指令的时分发现并不能履行,咱们就需求在Ubuntu中装置此指令,可是咱们在装置的过程中,发现并不能装置成功。为什么会呈现这种问题呢?

原因很简单,便是自带的源没有找到python3-pip这个包,所以咱们要先增加下面的源:

**怎么处理pip3装置不成功呢?**当然是换源啦。

# 翻开源配置文件

sudo vim /etc/apt/sources.list //这儿要注意咱们在退出保存的时分运用的指令是: :wq 而不是 :qw

# 在原有基础上增加以下的源

deb http://c王芗远n.archive.ubuntu.com/ubuntu bionic main multiverse restricted univesgpyrse
deb http://cn.archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://cn.archive.ubuntu.com/ubuntu bionic-proposed main multiverse restricted universe

# 更新一下源

sudo apt update

如图(前四个便是咱们增加的源):

装置结束之后咱们检查以下版别:

gxa@gxa-virtual-machine:~$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

然后咱们履行以下指令,装置selenium库:

或许履行(sudo apt install python3-pip)

完结以上过程之后,咱们履行以下指令奥:

能够看到两个库现已装置成功啦。

咱们之前现已是说过selenium的效果啦,所以这种库当然是要合作浏览器了啊。关于怎么在ubuntu中装置goole-chrome?

四、接下来咱们装置chromedriver

首要咱们翻开goole-chrome检查版别号,然后在chromedriver的官网上下载对应的版别。

咱们能够看到版别号是75.0.3440.100。那么咱们就在官网下载相应版别。下载结束之后咱们:将文件移动到/usr/bin目录下,可是博主在移动的时分呈现了以下状况:

为什么文件一向没移动成功呢?那是由于咱们虚拟机上根本就没有/home/gax/桌面/chromedriver折耳根文件目录。所以我改动以下移动方法。cd桌面移动此文件。

终究文件被成功移动。

咱们输入指令:chromedrier发动。

ok啦。

相关文章

标签列表