python秒杀神器苏宁_Python苏宁易购免费试用申请一键执行脚本源代码

# -*- coding: utf-8 -*-

# 主题 : 苏宁易购试用申请

# 版本 : 1.0(Python 3)

# 时间 : 2019.09.28

# 作者 : 池塘里的大鳄鱼

# 说明 : 需要先在59、60行输入账号密码,登录次数过多会出现滑块验证可将56-61行注释掉,选择下方63-66行手动登录方式。申请次数上限好像是50次/天。鼠标点击坐标值可能需要重设

import requests

import re

from selenium.webdriver.common.action_chains import ActionChains

from selenium import webdriver

import win32api,win32con

from time import sleep

# 获取所有试用商品

def get_all_product_id():

urls = ['https://try.m.suning.com/mtp-web/api/index/batchCategoryProductBriefInfoByPageList/getFreeTabData1569656586954-1-101--1-1000.jsonp',

'https://try.m.suning.com/mtp-web/api/index/batchCategoryProductBriefInfoByPageList/getFreeTabData1569656734752-1-103--1-1000.jsonp',

'https://try.m.suning.com/mtp-web/api/index/batchCategoryProductBriefInfoByPageList/getFreeTabData1569656778689-1-102--1-1000.jsonp',

'https://try.m.suning.com/mtp-web/api/index/batchCategoryProductBriefInfoByPageList/getFreeTabData1569656845737-1-104--1-1000.jsonp']

product_id_list = []

for url in urls:

r = requests.get(url)

info = r.text

product_id = re.findall('(?<="productId":)(.*?)(?=,)', info)

product_id_list += product_id

return product_id_list

# 获取商品子ID

def get_child_id(driver, product_id): # 需设置火狐浏览器

url = 'https://c.m.suning.com/sy_content.html?productId=' + product_id

driver.get(url)

page = driver.page_source

child_id = re.findall('(?<=data-id=")(.*?)(?=")', page)

return child_id

# 检测已经申请过的所有商品

def cheek_exist_product(driver):

url = 'https://c.m.suning.com/sy_myApply.html?code=0'

driver.get(url)

page = driver.page_source

product_id = re.findall('(?<=data-productid=")(.*?)(?=")', page)

return product_id

# 主程序

def main():

driver = webdriver.Firefox()

driver.set_window_size(370, 740) # 设置浏览器窗口大小, 配合鼠标定位使用

# 先登陆苏宁账号

driver.get('https://passport.suning.com/ids/login?service=https://aq.suning.com/asc/auth?targetUrl=https://m.suning.com/&loginTheme=wap_new')

driver.implicitly_wait(3)

sleep(1) # 休眠1秒

driver.find_element_by_css_selector('.other_btn1').click()

driver.implicitly_wait(3)

sleep(1)

driver.find_element_by_css_selector('#username').send_keys('苏宁账户名称')

driver.find_element_by_css_selector('#password').send_keys('苏宁账户密码')

driver.find_element_by_css_selector('div.btnBox:nth-child(7) > a:nth-child(1)').click()

# # 等待登陆

# win32api.MessageBox(0, "请在网页上登录后到Python中继续下一步操作!", "登陆确认", win32con.MB_OK)

# # 等待用户登录

# input('*' * 10 + '按回车键继续操作' + '*' * 10)

print('-' * 35)

print('程序正在自动执行中...')

all_ids = get_all_product_id()

all_ids = set(all_ids)

exist_id = cheek_exist_product(driver)

exist_id = set(exist_id)

ids = all_ids - exist_id

ids = list(ids)

i = 0

# driver.get('https://c.m.suning.com/snsy.html')

for id in ids:

i += 1

print('正在执行第{}个任务'.format(i))

cid = get_child_id(driver, id)

cid = cid[0]

print(cid)

url = 'https://c.m.suning.com/sy_applyIndex.html?adTypeCode=470001&id=' + cid

driver.get(url)

sleep(1)

ActionChains(driver).move_by_offset(300, 637).click().perform() # 点击申请 不同分辨率的电脑可能需要重新设置(300, 637)这个坐标

sleep(1)

ActionChains(driver).move_by_offset(-300, -637).perform() # 滚回鼠标位置 不同分辨率的电脑可能需要重新设置(-300, -637)这个坐标

print('共执行{}个任务'.format(i))

win32api.MessageBox(0, '共执行{}个任务'.format(i), '执行完毕', win32con.MB_OK)

driver.close()

if __name__ == '__main__':

main()

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
【开发版V4.0】2020新版京东淘宝拼多多自动抢单系统源码|全开源|接单返佣 可完美运行某站3000+源码直接打包!! 一款新上线的淘宝自动抢单平台,跟传统抢单大的区别就是平台取用第三方匹配平台,自动匹配订单,简单化了程序,效率更高,收益更高,使用户、商家,平台都有得益! 全新界面简洁美观,功能强大完整,完美运营,持续更新中! 全开源系统,免授权无后门,资金安全有保障,无后顾之优! 更新日志: Ⅰ、新增利息宝功能,余额转入理财 Ⅱ、优化抢单体验,显示随机倒计时和提示内容 Ⅲ、新增首页和订单页面UI特效 Ⅳ、修复抢单页面回调不能返回原分类的问题 Ⅴ、修复邀请码必填项 Ⅵ、新增抢单时间段控制 Ⅶ、新增完成多少任务量才可提现等多项规则,有效控盘。 Ⅷ、新增后台代理商数据报表,实时查看网体数据,提升运营效率。 Ⅸ、新增抢单提示音 Ⅹ、新增充值提现时间段设置 。。。 操作方法:扫码注册登录APP,填写收货信息,充值(100元起),建议先充值100元试水,充值时平台会有上下浮动金额,按平台提示金额充值就可以了。 佣金是所抢金额的0.31%,可抢订单金额是余额的10-70%,每天可抢70单,抢单时间为每天8-20点。 温馨提示:若您选择了自动抢单且离开抢单界面有可能系统派单了您没接收到,导致订单被冻结。建议您点击自动抢单了不要离开抢单界面。或者有事离开的时候点击停止抢单。系统 才能知道您已经取消了抢单操作。 代理制度:可享往下三级代理佣金,一级16%、二级8%、三级4。 提现规则:佣金满100元就可以提现,提现T+1到账,15点前。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值