zoukankan      html  css  js  c++  java
  • pyttsx3 winsound win32api.MessageBox使用案例

    import requests,time
    from lxml import etree
    import win32api,win32con
    import winsound
    import pyttsx3
    
    cookies = str(input('请输入cookies:'))
    
    def ring():
        engine = pyttsx3.init()
        engine.say('傻逼,有户了,赶紧去抢')
        engine.runAndWait()
    
    def check_account():
        today = time.strftime('%Y-%m-%d',time.localtime())
        url1 = 'http://cm.admin.weibo.com/customer_base/customer_base.php?hiddenuid=2&exportuid=&uid=&nickname=&start_storage_time={}&end_storage_time=+{}+&type_status=2&source=&start_open_time=&end_open_time=&filed=0&industry=0&one_industry=0&region=0&one_region=0'
        headers ={'Cookie': cookies,
        'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36',
        'Host': 'cm.admin.weibo.com',
        }
        time.sleep(3)
        res = requests.get(url1.format(today,today),headers=headers)
        html = etree.HTML(res.text)
        html_data = html.xpath('//*[@id="listTable"]/tbody/tr/td[3]/text()')
        if len(html_data) >0:
            print('哈哈傻逼,出来' + str(len(html_data)) + '个户,赶紧抢,他们是:'+ ','.join(html_data))
            win32api.MessageBox(win32con.NULL,'哈哈傻逼,出来' + str(len(html_data)) + '个户,赶紧抢,他们是:'+ ','.join(html_data) , '有户了,快特么领去', win32con.MB_OK)
            winsound.Beep(600,500)
            ring()
            return True
        else:
            print('没有户')
            return False
    
    if __name__ == '__main__':
        count = 1
        while True:
            todayHS = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime())
            print('时间:%s 第 %s 次查询-----> '% (todayHS,str(count)),end='')
            flag=check_account()
            if flag is True:
                break
            count +=1
  • 相关阅读:
    VKD224B触摸芯片调试笔记
    liunx 常用命令学习笔记
    2440 裸机学习 点亮LED
    单端正激变换器
    c# 文件与流
    c# 接口笔记
    Ubuntu18.04 server安装步骤
    how to force git to overwritten local files
    Linux基础
    解决Linux下Firefox无法启动的问题
  • 原文地址:https://www.cnblogs.com/Erick-L/p/8890731.html
Copyright © 2011-2022 走看看