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
  • 相关阅读:
    Photoshop给草坡上的人物加上大气的霞光
    Photoshop给人像加上个性裂纹肌肤
    Photoshop快速给美女人像换头发
    Oracle和SQLite位数不足补0
    Oracle和Postgis数据库地理坐标系下面积计算
    SQLite3中自增主键归零方法
    Arcgis-Tools_06矢量数据按国土分解
    Arcgis-Issues_03Arcgis最佳路径分析
    Arcgis-Tools_05批量导出地图
    Oracle_C#连接Oracle数据库
  • 原文地址:https://www.cnblogs.com/Erick-L/p/8890731.html
Copyright © 2011-2022 走看看