Skip to content

Instantly share code, notes, and snippets.

@CandyMi
Last active November 10, 2020 07:08
Show Gist options
  • Select an option

  • Save CandyMi/c60a17e3b2b04c453e9508dbf24727dd to your computer and use it in GitHub Desktop.

Select an option

Save CandyMi/c60a17e3b2b04c453e9508dbf24727dd to your computer and use it in GitHub Desktop.
测试代码
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