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

  • 相关阅读:
    分布式事务
    K8s应用案例介绍——阿里云
    数据库索引的底层原理——b树
    Understanding the GitHub flow
    Code Review
    详解微服务架构
    yarn之package.json
    yarn.lock文件
    Git Api——git开发
    Unit Test —— xUnit.net
  • 原文地址:https://www.cnblogs.com/watermarks/p/14774543.html
Copyright © 2011-2022 走看看