mac os+selenium2+chrome驱动+python3
来源:互联网 发布:boost算法 编辑:程序博客网 时间:2024/04/29 13:41
mac os 10.11.5
mac自带python2.7,自己下载了python3.5,pip list查看系统中的安装包,本人电脑中已经安装了pip和setuptools,若未安装,请先使用
sudo apt-get install python3-setuptools
sudo apt-get install python3-pip
若使用命令有问题,可自行到官网下载相应安装包,执行python setup.py install 安装即可;
1、安装selenium
执行 python3 -m pip install selenium
2、安装chrome驱动
驱动下载地址:http://docs.seleniumhq.org/download/选择对应系统的浏览器驱动
或者直接到
https://sites.google.com/a/chromium.org/chromedriver/下载最新版mac chrome驱动(需翻墙);
我下载了mac64.zip和linux64.zip,共享地址:
链接: https://pan.baidu.com/s/1nvdKv7F 密码: uc2i
使用uname -a
查看自己的系统是64位还是32位;
3、配置chrome驱动
将解压后的chromedriver移动到/usr/local/bin目录下
否则在运行脚本时,会提示
chromedriver executable needs to be in PATH错误
4、selenium第一个脚本
编写第一个selenium脚本程序:
#!/user/bin/env python# -*-coding:utf-8-*-# @time : 16/11/8 12:09# @Author : Zhangxy# @File : 001baiduSearch.py# @Software : PyCharmfrom selenium import webdriverdriver = webdriver.Chrome()driver.get("http://www.baidu.com")driver.find_element_by_id('kw').send_keys('selenium')driver.find_element_by_id('su').click()#driver.quit()
运行结果如下:
还有点小激动呢,嘻嘻!
1 0
- mac os+selenium2+chrome驱动+python3
- mac os+selenium2+Firefox驱动+python3
- mac配置python3+selenium+chrome
- mac os x 10.9安装python3.4.1
- Mac OS 安装 OpenCV (python3)
- mac os+python3+opencv3环境配置
- mac os+python3+opencv3环境配置
- Mac OS X中Apache+PHP+MySQL配置
- 自动化测试环境Python3+selenium2
- 在MAC OS X中配置php+apache+mysql
- 在MAC OS X中配置php+apache+mysql
- portaudio 安装教程(mac OS X系统 + Xcode)
- Mac OS X 10.10中配置Apache + PHP
- Mac OS X 10.10 配置 nginx + php
- Mac os 10.5.8, 驱动无线网卡
- Mac os 10.5.8, 驱动声卡成功
- Mac OS X内核。驱动开发
- Mac OS 10.9声卡完美驱动^-^
- J2SE第三章——面向对象(二)
- HTTP基本原理(http1.0与http1.1之区别)
- 有关send()函数的理解
- HDU ACM 11 2087 剪花布条
- 有关内部类②
- mac os+selenium2+chrome驱动+python3
- 洛谷P1951 BSOJ2636 CODEVS4175 收费站
- 最长考拉兹序列
- IUser
- 流式布局FlowLayout
- IMember
- Caffe调参经验资料文章
- Google Chrome Top60 实用插件集合
- 用python参加Kaggle的些许经验总结