1. 程式人生 > 其它 >python爬蟲學習(七):驗證碼識別

python爬蟲學習(七):驗證碼識別

配置網路準備環境

配置網路
[root@localhost ~]# nmcli connection modify ens32 ipv4.addresses 192.168.10.10/24 ipv4.gateway 192.168.10.2 ipv4.dns 8.8.8.8 ipv4.method manual 
[root@localhost ~]# nmcli connection reload 
[root@localhost ~]# nmcli connection up ens160
測試網路
[root@localhost ~]# ping www.baidu.com
關閉防火牆和selinux
[root@localhost ~]# systemctl disable --now firewalld
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# setenforce 0
更新yum源
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo  http://mirrors.aliyun.com/repo/Centos-7.repo

設定docker倉庫並安裝要安裝的包

安裝工具包
[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
設定遠端倉庫
[root@localhost ~]# yum-config-manager --add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安裝docker-ce

清理老的docker
[root@localhost ~]# yum remove docker docker-client docker-client-latest docker-common \
   docker-latest docker-latest-logrotate docker-logrotate docker-engine
安裝docker
[root@localhost ~]# yum -y install docker-ce
#安裝指定版docker-ce
[root@localhost ~]# yum -y install docker-ce-19.03.2-3.el7 docker-ce-cli-19.03.2-3.el7 containerd.io

啟動docker並設定開機自啟

[root@localhost ~]# systemctl enable --now docker

測試docker

[root@localhost ~]# docker run hello-world
nable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:97a379f4f88575512824f3b352bc03cd75e239179eea0fecc38e597b2209f49a
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

一鍵指令碼安裝

curl -sSL https://get.daocloud.io/docker | sh