from selenium import webdriver
from time import sleep
from selenium.webdriver import ActionChains
dri = webdriver.Chrome(executable_path='./chromedriver.exe')
dri.get('http://af.51dsw.cc/?cid=18&tid=1660')
'https://www.ieqq.net/?cid=222&tid=5584'
sleep(3)
search_input = dri.find_element_by_xpath('//*[@id="inputvalue"]')
sleep(3)
search_input.send_keys('xxxxxxxxxx')
dri.execute_script('window.scrollTo(0,document.body.scrollHeight)')
sleep(2)
btn = dri.find_element_by_xpath('//*[@id="submit_buy"]')
btn.click()
sleep(3)
yanzheng1 = dri.find_element_by_xpath('//*[@id="captcha"]/div[3]/div[3]').click()
sleep(3)
action = ActionChains(dri)
huakuai = dri.find_element_by_xpath('/html/body/div[9]/div[2]/div[2]/div[1]/div[2]/div[2]')
action.click_and_hold(huakuai)
for i in range(5):
action.move_by_offset(7,0).perform()
sleep(0.5)