网站地图

当前位置: 震情作文网 > 收压岁钱作文

BliBli抢楼全攻略

时间:2022-06-23 03:09人气:来源: 未知
from selenium import webdriver
import requests
from re import findall
from bs4 import BeautifulSoup
import time


def get_cookies():
    driver = webdriver.Opera()
    url =''
    driver.get(url)
    driver.find_element_by_xpath('//*[@id="userIdTxt"]').send_keys(input('请输入用户名'))
    driver.find_element_by_xpath('//*[@id="passwdTxt"]').send_keys(input('请输入密码'))
    driver.find_element_by_xpath('//*[@id="vdCodeTxt"]').click()
    driver.find_element_by_xpath('//*[@id="vdCodeTxt"]').send_keys(input('请输入验证码(不分大小写)'))
    driver.find_element_by_css_selector(
        'body > div.head_foot_content > div > div.content-bd > div.content-r > form > input.login').click()
    if driver.current_url != url:
        print('登录成功')
        qianglou(driver.get_cookies())
    else:
        print('登陆失败,请重试')
        get_cookies()


def qianglou(cookie):
    cookies = {
        'DedeUserID': cookie[1].get('value'),
        'DedeUserID__ckMd5': cookie[2].get('value'),
        'SESSDATA': cookie[3].get('value'),
        # 'DedeUserID': ,
        # 'DedeUserID__ckMd5': 'fff63aa9b5e53ec3',
        # 'SESSDATA': 'f1e%2C%2Cba',
    }
    anime_num =input('请输入要抢楼的番剧编号
->')
    message =input('请输入要发送的信息
->')
    url ='' + str(anime_num)
    i =1
    get_av_num(url, message, cookies, i)


def get_av_num(url, message, cookies, i):
    print('try', i)
    content =BeautifulSoup(requests.get(url).content.decode('utf8', 'ignore'), 'lxml')
    av_infos =content.find('a', class_='v-av-link')
    if av_infos is None:
        i +=1
        get_av_num(url, message, cookies, i)
    av_infos =av_infos.text + '/'
    av_num =findall('AV(.*?)/', av_infos)[0]
    av_num =int(av_num)
    data = {
        'message': message,
        'type': 1,
        'oid': av_num
    }
    send_message(cookies, data)


def send_message(cookies, data):
    url =''
    content =requests.post(url, data=data, cookies=cookies).content.decode('utf8', 'ignore')
    result =findall('"message":"(.*?)"', content)
    if result[0]=='ok':
        print('发送完成')
    else:
        send_message(cookies, data)


if __name__=='__main__':
    get_cookies()
    # qianglou()

文章来源: http://www.everstarry.com文章标题: BliBli抢楼全攻略

原文地址:http://www.everstarry.com/sysqzw/11622.html

上一篇:关于手机定位轨迹的算法

网站首页

下一篇:没有了



本类导航