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()
结果: