1.
账号密码登录在iframe框架里
2.账号密码登陆ID
3.
#selenium模拟QQ空间登录from selenium import webdriverfrom time import sleepfrom mon.by import Bybro=webdriver.Chrome()#得到QQ空间浏览器自动化对象bro.get('/')#处理iframe框架bro.switch_to.frame('login_frame')#定位到“账号密码登录标签”a_tag=bro.find_element(By.ID,'switcher_plogin')#点击a_tag.click()#进入到一个新界面#定位用户账号和密码user_account=bro.find_element(By.ID,'u')user_pwd=bro.find_element(By.ID,'p')#输入账号和密码sleep(1)user_account.send_keys('2634999999')sleep(1)user_pwd.send_keys('zzzzzzzzz')sleep(1)#点击登陆按钮btn=bro.find_element(By.ID,'login_button')btn.click()sleep(3)bro.quit()