from selenium import webdriver from time import sleep from selenium.webdriver.common.action_chains import ActionChains driver=webdriver.Chrome() driver.get('https://lbs.amap.com/') driver.maximize_window() driver.find_element_by_xpath('/html/body/div/header/div/div[3]/div[2]/div[1]/a[1]/span').click() driver.find_element_by_class_name('input--jss-0-59').click() sleep(2) driver.find_element_by_class_name('input--jss-0-59').send_keys('xxxxxxx') sleep(3) driver.find_element_by_xpath('/html/body/div[2]/div/div[3]/div[3]/div[1]/form/div[2]/input').click() sleep(2) driver.find_element_by_xpath('/html/body/div[2]/div/div[3]/div[3]/div[1]/form/div[2]/input').send_keys('xxxxx') slider = driver.find_element_by_xpath('/html/body/div[2]/div/div[3]/div[3]/div[1]/form/div[3]/div/div[1]/div[2]/span') # 滑块解锁 action = ActionChains(driver) action.click_and_hold(slider) # 按住 action.move_by_offset(312, 0) # 往右偏移248个像素 action.release() # 释放鼠标 action.perform() # 执行 # 点登陆按钮 driver.find_element_by_xpath('/html/body/div[2]/div/div[3]/div[5]/button').click()
#滑动解锁自动化
最新推荐文章于 2024-07-23 15:36:19 发布