ubuntu16.04安装python3 selenium
2017-10-18 09:17
567 查看
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.keys import Keys def open100Chrome(): begin = 1 end = 3 for flag in range(begin, end): browser = webdriver.Chrome() # Version 61.0.3163.91 (Official Build) (64-bit) # browser = webdriver.Firefox() browser.get('http://www.yahoo.com') assert 'Yahoo' in browser.title elem = browser.find_element_by_name('p') # Find the search box elem.send_keys('seleniumhq' + Keys.RETURN) browser.quit() if __name__ == "__main__": open100Chrome()
# -*- coding: utf-8 -*-
import unittest
from selenium import webdriver
class GoogleTestCase(unittest.TestCase):
def setUp(self):
# self.browser = webdriver.Firefox()
self.browser = webdriver.Chrome()
self.addCleanup(self.browser.quit)
def testPageTitle(self):
# self.browser.get('http://www.google.com')
self.browser.get('http://www.yahoo.com')
self.assertIn('Yahoo', self.browser.title)
if __name__ == '__main__':
unittest.main(verbosity=2)
相关文章推荐
- Ubuntu16.04 Selenium+python 环境搭建 Chromedriver安装
- ubuntu 16.04 安装 python selenium
- Ubuntu16.04自带Python2.7和Python3,为什么用pip安装的包在Python3中不能用
- ubuntu 16.04 安装 opencv +contrib (3.2.0) + python 3.5
- (ubuntu16.04)关于caffe+python3.5(非anaconda安装)编译的一些问题
- ubuntu16.04下安装teamviewer远程控制软件+opencv2-for-python
- ubuntu16.04环境下安装Python SPAMS包
- ubuntu 16.04安装caffe(python2)
- Ubuntu16.04+python3.5+opencv3.3.1+opencv_contrib编译安装
- ubuntu python3 安装selenium及chrome的环境配置
- Ubuntu16.04 安装Python开发环境
- 在Ubuntu 16.04 中安装配置 Opencv 3.1 和 Python 2.7 / Python 3.5
- ubuntu16.04 python3安装opencv及tensorflow
- 【python】Linux Ubuntu16.04 安装Python3.6
- ubuntu16.04 python3.5下安装tensorflow(cpu only)
- (转)ubuntu 16.04下安装Python数据挖掘所需环境
- Ubuntu16.04 Python 3.6安装Pytorch 0.2
- Ubuntu 16.04安装PyCharm-Python IDE
- Ubuntu16.04LTS上安装Python3.6.3
- ubuntu16.04安装caffe python接口安装