#!/usr/bin/python
#-*-Coding:utf-8-*-
__author__ = ' Zuoanvip '
#一般情况下我们要验证打开的页面是否正确, can be verified by the title and Current_url of the Web page
From selenium import Webdriver
Driver = Webdriver. Firefox ()
Driver.get (' http://www.baidu.com ')
#获取当前的网页标题
Driver.title
#获取当前的页面URL
Driver.current_url
#设置等待时间, there are three ways: sleep () fixed wait time, implicitly_wait () Smart wait, over time to throw an exception, webdriverwait () in the set time interval of every interval of detection, if not detected, throw an exception
#导入WebDriverWait包
From Selenium.webdriver.support.ui import webdriverwait
#导入time包
Import time
#WebDriverWait包的用法
element = Webdriverwait (driver,10). Until (Lambda driver:driver.find_element_by_id (' xx '))
#implicitly用法
Driver.implicitly_wait (10)
#添加固定休眠时间
Time.sleep (5)
Selenium python (v) Print information and set wait time