是python鸭

淘宝破解登录-没成功版

from selenium import webdriver
#import TbConfig
#from selenium.webdriver.common.action_chains import Actionchains
import selenium
import time
# 此步骤很重要
chromeOptions = webdriver.ChromeOptions()
# chromeOptions.add_argument('-headless')  # 设为无头模式
# chromeOptions.add_argument('disable-infobars')  # 去掉提示:Chrome正收到自动测试软件的控制
chromeOptions.add_experimental_option('excludeSwitches', ['enable-automation'])  # 以键值对的形式加入参数
driver = webdriver.Chrome(chrome_options=chromeOptions)

driver.get('http://www.taobao.com')
driver.maximize_window()
driver.find_element_by_xpath('//*[@id="J_SiteNavLogin"]/div[1]/div[1]/a[1]').click()
driver.find_element_by_xpath('//*[@id="fm-login-id"]').send_keys('你得用户名')
driver.find_element_by_xpath('//*[@id="fm-login-password"]').send_keys('你的密码')
time.sleep(3)
                             
slider = driver.find_element_by_xpath("//span[contains(@class,'btn_slide')]")
selenium.webdriver.common.action_chains.ActionChains(driver).click_and_hold(on_element=slider).perform() 
selenium.webdriver.common.action_chains.ActionChains(driver).move_by_offset(xoffset=300,yoffset=0).perform() 
selenium.webdriver.common.action_chains.ActionChains(driver).pause(0.5).release().perform()
driver.find_element_by_xpath('//*[@id="login-form"]/div[4]/button').click()

破解了一天淘宝,终于会了模拟滑块登录,结果ip被封啦,暂时登陆不进去啦

淘宝破解登录-没成功版已关闭评论