deepin15.11安裝selenium+chrome+chromedriver
安裝chrome
deepin15.11默認安裝chrome瀏覽器
版本 78.0.3904.97(正式版本) (64 位)
安裝selenium
pip3 install selenium
安裝chromedirver
下載
下載鏈接選擇與瀏覽器版本配套的chromedirver版本
解壓
unzip chromedriver_linux64.zip
將chromedriver復制到/usr/bin/
sudo mv chromedriver /usr/bin/
賦權限
sudo chmod 755 /usr/bin/chromedriver
測試
#!/usr/bin/python3
# -*- condig:utf-8 -*-
from selenium import webdriver
chrome = webdriver.Chrome()
chrome.get('https://www.baidu.com/')
chrome.find_element_by_id('kw').send_keys('selenium')
chrome.find_element_by_id('su').click()