python selenium环境安装及配置_python+Visual studio code配置Selenium环境

python+Visual studio code配置Selenium环境

使用pip命令安装selenium

Visual studio code控制台中直接输入:

python -m pip install selenium

bVbjpWI?w=1443&h=118

查看是否安装selenium成功

Visual studio code中直接输入:

pip show selenium

bVbjpXD?w=789&h=186

安装ChromeDriver、Firefox Geckodriver

将chromedriver.exe、geckodriver.exe放在python安装目录,或将chromedriver.exe所在目录添加到环境变量path中

检查Selenium+python+Visual studio code是否配置成功

# coding:utf-8

from selenium import webdriver

# 创建Firefox对象

# driver = webdriver.Firefox()

driver = webdriver.Chrome()

driver.get('https://cn.bing.com/')

driver.quit()

版本

python版本3.6.4

PS D:\Python\selenium> python

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

Selenium版本3.141.0

PS D:\Python\selenium> pip show selenium

Name: selenium

Version: 3.141.0

Summary: Python bindings for Selenium

Home-page: https://github.com/SeleniumHQ/selenium/

Author: UNKNOWN

Author-email: UNKNOWN

License: Apache 2.0

Location: c:\programs\python\python36-32\lib\site-packages

Requires: urllib3

Required-by:

Chrome版本 70.0.3538.77(正式版本) (64 位)

ChromeDriver版本2.43

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值