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:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\Scripts

然后在运行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

posted @ 2021-05-16 19:01  po-A  阅读(500)  评论(0编辑  收藏  举报

Tushare大数据开放社区-免费提供各类金融数据和区块链数据 , 助力智能投资与创新型投资。

Python, Matlab, R, Web数据抽取学习交流。