Selenium-浮层的操作

实现-百度登录浮层-输入登录用户名

#! /usr/bin/env python
#coding=utf-8

'''
百度首页-登录浮层
'''

from selenium import webdriver
import time

driver = webdriver.Firefox()
driver.get("https://www.baidu.com/")
time.sleep(3)

driver.find_element_by_link_text("登录").click()

driver.find_element_by_id("TANGRAM__PSP_10__userName").send_keys("会跑的熊")

time.sleep(3)

driver.quit()

结果:

posted @ 2017-09-03 02:01  R-Bear  阅读(1137)  评论(0编辑  收藏  举报