zoukankan      html  css  js  c++  java
  • python pip安装selenium时报错, ..has requirement websocket-client==0.48.0, but you'll have websocket -client 0.57.0 which is incoopatibale.

    默认打开cmd,无法执行pip install selenium,报错:‘pip‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。

    所以cd到python script的根目录,cd C:UsersAdministratorAppDataLocalProgramsPythonPython37-32Scripts

    然后在运行pip install selenium

    报错:waston-developer-cloud 2.6.0 has requirement websocket-client==0.48.0, but you'll have websocket -client 0.57.0 which is incoopatibale.

     只能手动安装了。

    参考这篇博客:https://www.cnblogs.com/xiaxiaoxu/p/8909622.html

    chromedriver的安装这里略。

    然后,python测试一下chromedriver的安装。

    import time
    from selenium import webdriver
    
    driver = webdriver.Chrome('C:/Program Files (x86)/Google/Chrome/Application/chromedriver') # Optional argument, if not specified will search path.
    driver.get('http://www.google.com/');
    time.sleep(5) # Let the user actually see something!
    
    driver.maximize_window()
    search_box = driver.find_element_by_name('q')
    search_box.send_keys('ChromeDriver')
    search_box.submit()
    time.sleep(5) # Let the user actually see something!
    driver.quit()
    

      测试成功。

    ref:https://sites.google.com/a/chromium.org/chromedriver/getting-started

  • 相关阅读:
    随机生成30到四则运算题目2 (修改)
    随机生成30到四则运算题目2
    随机生成30道四则运算题目
    第一周学习进度表
    构建之法阅读笔记01
    个人简介
    个人简介
    bat 延时删除指定文件夹中的文件经验分享
    centos 7 (操作应用)-关闭防火墙
    mysql数据库迁移
  • 原文地址:https://www.cnblogs.com/watermarks/p/14774543.html
Copyright © 2011-2022 走看看