from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
driver = webdriver.Chrome()
driver.get('https://007.qq.com/online.html')
driver.find_element_by_id('code').click()
time.sleep(3)
driver.switch_to.frame(1)
element = driver.find_element_by_id('tcaptcha_drag_thumb')
ActionChains(driver).click_and_hold(on_element=element).perform()
ActionChains(driver).move_to_element_with_offset(to_element=element,xoffset=245,yoffset=0).perform()
ActionChains(driver).release(on_element=element).perform()
|