Log in to Qzone using selenium
Log in to Qzone using selenium
Open Qzone
Coding: utf-8--
File: 3. Log in to Qzone .py
Author: HuXianyong
Date: 2018-09-12 14:56
From selenium import webdriver
Chrom = webdriver.Chrome ()
Url = 'https://qzone.qq.com/'
Chrom.get (url)
# what this means is that before we choose an account to log in, we have to select the white box of the qq login method to make a choice, otherwise we will report an error if there is no account login option on the page.
Chrom.switch_to.frame ("login_frame")
# Select an account to log in
Chrom.find_element_by_id (switcher_plogin) .click ()
Write the account number and password and then log in to Qzone
-coding: utf-8-
File: 3. Log in to Qzone .py
Author: HuXianyong
Date: 2018-09-12 14:56
From selenium import webdriver
Chrom = webdriver.Chrome ()
Url = 'https://qzone.qq.com/'
Chrom.get (url)
# what this means is that before we choose an account to log in, we have to select the white box of the qq login method to make a choice, otherwise we will report an error if there is no account login option on the page.
Chrom.switch_to.frame ("login_frame")
# Select an account to log in
Chrom.find_element_by_id (switcher_plogin) .click ()
# find the ID corresponding to the user name
Username = chrom.find_element_by_id ("u")
# send login account to the ID of the corresponding password
Username.send_keys ("56273754")
# obtain the ID of the corresponding password
Passwd = chrom.find_element_by_id ("p")
# send login password to the ID of the corresponding password
Passwd.send_keys ("mgh****3")
Chrom.find_element_by_id (login_button) .click ()
# exit the browser window
Chrom.quit ()
Log in and see some results.
Login here is complete.