安装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()

相关文章:

  • 2021-11-19
  • 2022-01-05
  • 2022-01-12
  • 2022-01-05
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-08
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-02-08
相关资源
相似解决方案