Last active
November 10, 2020 07:08
-
-
Save CandyMi/c60a17e3b2b04c453e9508dbf24727dd to your computer and use it in GitHub Desktop.
测试代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium import webdriver | |
| from selenium.webdriver import ChromeOptions | |
| from selenium.webdriver.common.action_chains import ActionChains | |
| username = "你的账号" | |
| password = "你的密码" | |
| from time import sleep | |
| options = ChromeOptions() | |
| options.add_experimental_option('excludeSwitches', ['enable-automation']) | |
| driver = webdriver.Chrome(options = options) | |
| driver.maximize_window() | |
| driver.get('''https://www.tcpjw.com/passport/login''') | |
| driver.find_element_by_xpath("//input[@class='ant-input login-input']").send_keys(username) | |
| driver.find_element_by_xpath("//span//input[@class='ant-input']").send_keys(password) | |
| action = ActionChains(driver) | |
| action.drag_and_drop_by_offset(driver.find_element_by_id("nc_1_n1z"), 320, 0).perform() | |
| driver.find_element_by_xpath("//div[@class='detail']//button").click() | |
| sleep(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment