Download drive chromedriver, install the Google browser And then download the corresponding version of the chromedriver download address: chromedriver.storage.googleapis.com/index.html my Google browser is the latest version 9.1
So I downloaded the corresponding version and unpacked it
Copy Chromedriver. exe to the Python root directory and to the Google Chrome file location
To be ready, you first download Python and then install the corresponding modules such as PIP Install Selenium
from selenium importOpen a Chrome browser, Driver = webdriver.chrome () # open a url driver.maximize_window() # maximize the browsing window driver.get()"http://account.ryjiaoyu.com/log-in"Driver.find_element_by_xpath ()"//input[@id='Email']"Driver. Find_element_by_xpath ()"//input[@id='Email']").send_keys("Your account number"Driver. Find_element_by_xpath ()"//input[@id='Password']"Driver. Find_element_by_xpath ()"//input[@id='Password']").send_keys("Your password"Find_element_by_xpath ()"/ / input [@ value = 'log in']").click() # system automatically login page driver.quit() # system automatically close the browserCopy the code
You can modify your website to log in according to your own needs.
First, press F12 to view the corresponding code and change it to your username and account