安装chromedriver
sudo apt-get install -y chromium-browser
安装信息
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-87 linux-headers-4.4.0-87-generic linux-image-4.4.0-87-generic linux-image-extra-4.4.0-87-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
chromium-browser-l10n chromium-codecs-ffmpeg-extra
Suggested packages:
webaccounts-chromium-extension unity-chromium-extension adobe-flashplugin
The following NEW packages will be installed:
chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra
0 upgraded, 3 newly installed, 0 to remove and 212 not upgraded.
Need to get 63.3 MB of archives.
After this operation, 237 MB of additional disk space will be used.
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/universe amd64 chromium-codecs-ffmpeg-extra amd64 74.0.3729.169-0ubuntu0.16.04.1 [1,106 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/universe amd64 chromium-browser amd64 74.0.3729.169-0ubuntu0.16.04.1 [59.3 MB]
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/universe amd64 chromium-browser-l10n all 74.0.3729.169-0ubuntu0.16.04.1 [2,900 kB]
Fetched 63.3 MB in 1s (48.9 MB/s)
Selecting previously unselected package chromium-codecs-ffmpeg-extra.
(Reading database ... 160579 files and directories currently installed.)
Preparing to unpack .../chromium-codecs-ffmpeg-extra_74.0.3729.169-0ubuntu0.16.04.1_amd64.deb ...
Unpacking chromium-codecs-ffmpeg-extra (74.0.3729.169-0ubuntu0.16.04.1) ...
Selecting previously unselected package chromium-browser.
Preparing to unpack .../chromium-browser_74.0.3729.169-0ubuntu0.16.04.1_amd64.deb ...
Unpacking chromium-browser (74.0.3729.169-0ubuntu0.16.04.1) ...
Selecting previously unselected package chromium-browser-l10n.
Preparing to unpack .../chromium-browser-l10n_74.0.3729.169-0ubuntu0.16.04.1_all.deb ...
Unpacking chromium-browser-l10n (74.0.3729.169-0ubuntu0.16.04.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Setting up chromium-codecs-ffmpeg-extra (74.0.3729.169-0ubuntu0.16.04.1) ...
Setting up chromium-browser (74.0.3729.169-0ubuntu0.16.04.1) ...
Setting up chromium-browser-l10n (74.0.3729.169-0ubuntu0.16.04.1) ...
最后74.0.3729.169 这个是谷歌浏览器的版本号
然后下载对应的chromedriver
驱动的下载地址如下:
http://chromedriver.storage.googleapis.com/index.html
chromedriver与chrome的的对应版本
chromedriver版本 支持的chrome版本
v2.46 v72-74
v2.45 v70-72
v2.44 v69-71
v2.43 v69-71
v2.42 v68-70
v2.41 v67-69
v2.40 v66-68
v2.39 v66-68
v2.38 v65-67
v2.37 v64-66
v2.36 v63-65
v2.35 v62-64
v2.34 v61-63
v2.33 v60-62
v2.32 v59-61
v2.31 v58-60
v2.30 v58-60
ubuntu 安装chromedriver
// 下载对应的版本
wget -N http://chromedriver.storage.googleapis.com/index.html?path=74.0.3729.6/
// 解压
unzip chromedriver_linux64.zip
chmod +x chromedriver
// 复制文件
cp chromedriver /usr/bin/chromedriver