zoukankan      html  css  js  c++  java
  • 通过pip工具安装selenium(初次安装、升级),以及下载chromedriver.exe浏览器驱动

    1、初始安装

    语法:install selenium==版本号

    例:pip install selenium==3.141.0

    2、升级安装

    pip install --upgrade selenium

    3、下载浏览器驱动,地址:http://www.seleniumhq.org/download/   或 http://npm.taobao.org/mirrors/selenium/ 或https://npm.taobao.org/mirrors/chromedriver/

    (这时发现电脑上没有chrome,从https://www.google.cn/chrome/ 下载一个,但是不能用中文简体?)

    看了下chrome版本Version 80.0.3987.149 (Official Build) (64-bit),就从淘宝镜像下载了80.0.3987.16的chromedriver_win32.zip  

    并把解压出的chromedriver.exe复制到下面的baidu.py所在目录

    4 调试。baidu.py代码:

    #coding=utf-8
    from selenium import webdriver
    
    driver = webdriver.Chrome("chromedriver.exe")
    driver.get("http://www.baidu.com")
    
    driver.quit()

    运行成功。

    参考:https://www.cnblogs.com/benpao1314/p/8940713.html

    https://www.cnblogs.com/imyalost/p/7242524.html

  • 相关阅读:
    JS常见异常
    Spring boot 的 @Value注解读取配置文件中的00开头的字符串
    常用网址
    IntelliJ使用教程
    eclipse
    swagger
    Mybatis
    Linux常用命令
    阿里云短信
    Flink Checkpoint-轻量级分布式快照
  • 原文地址:https://www.cnblogs.com/pu369/p/12600197.html
Copyright © 2011-2022 走看看