from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from time import sleep
web_driver = webdriver.Chrome()
web_driver.get("https://qzone.qq.com/")
#切换作用域
web_driver.switch_to.frame("login_frame")
#标签定位
a_tag = web_driver.find_element(By.ID, "switcher_plogin")
a_tag.click()
sleep(5)
username_tag = web_driver.find_element(By.ID, "u")
password_tag = web_driver.find_element(By.ID, "p")
username_tag.send_keys("your_username")
sleep(2)
password_tag.send_keys("your_password")
sleep(2)
login_btn = web_driver.find_element(By.ID, "login_button")
sleep(2)
login_btn.click()
sleep(5)
print("?????????")
标签:qq,web,登录,selenium,driver,tag,sleep,find
From: https://www.cnblogs.com/lin513/p/18047374