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

pyttsx3 winsound win32api.MessageBox使用案例的更多相关文章

  1. scrapy 报错 no module named win32api 的解决方案

    解决方案: 原因是缺少win32,到 http://sourceforge.net/projects/pywin32/files/ 找到对应的版本进行下载,直接安装即可 =============== ...

  2. Python -- Gui编程 -- Win32API的使用

    消息框 messageBox.py import win32api, win32con win32api.MessageBox(0, 'Hello World!', 'Come Here', win3 ...

  3. python3下调用系统massagebox对话框

    #python3下调用系统massagebox对话框#先安装pwin32插件https://github.com/mhammond/pywin32/releases import win32apiim ...

  4. python爬虫之scrapy框架

    Scrapy是一个为了爬取网站数据,提取结构性数据而编写的应用框架. 其可以应用在数据挖掘,信息处理或存储历史数据等一系列的程序中.其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的, 也可以 ...

  5. Windows平台Python编程必会模块之pywin32

    在Windows平台上,从原来使用C/C++编写原生EXE程序,到使用Python编写一些常用脚本程序,成熟的模块的使用使得编程效率大大提高了. 不过,python模块虽多,也不可能满足开发者的所有需 ...

  6. python 系统定时关机

    #coding=utf-8 "shutdown at 23:00" from datetime import * import os import win32api import ...

  7. 2019-02-02 Python学习之多线程

    1.主线程和次线程 若主线程结束则次线程也会结束 如何避免主线程先结束: 结尾处加上 while True: pass e.g. import win32api #引用系统函数 import _thr ...

  8. py 使用win32 api

    http://timgolden.me.uk/pywin32-docs/contents.html https://docs.python.org/3/library/ctypes.html#ctyp ...

  9. Python 每日提醒写博客小程序,使用pywin32、bs4库

    死循环延迟调用方法,使用bs4库检索博客首页文章的日期是否与今天日期匹配,不匹配则说明今天没写文章,调用pywin32库进行弹窗提醒我写博客.

随机推荐

  1. iOS-明杰解决字段冲突,及数组映射

    /** 替换关键字的属性名 */ + (NSDictionary *)mj_replacedKeyFromPropertyName{ return @{@"UUID":@" ...

  2. Qt窗口及控件-窗口Close()自动释放

    版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:Qt-窗口Close()后自动释放空间     本文地址:http://techieliang ...

  3. win7系统日志分支删除方法

    这篇日志有问题,自己亲身尝试失败,这里只提供思路,谢谢(改天突破再做修改) 之前电脑装过德国的叫啥子软件来着,当时在系统自动创建了日志,后来软件卸载了,发现还是有这个日志主键,(我有强迫症)心里不爽, ...

  4. C# 使用this的形参

    示例1: public static RectangleF TransformRect(this Matrix mat, RectangleF rect) 是向Matrix类扩展带有Rectangle ...

  5. java 文件操作知识点

    1.每个文件以一个文件路径和文件名称进行表示,在不同的操作系统环境下,文件路径的表示形式是不一样的,例如在Windows操作系统中一般的表示形式为C:\windows\system,而Unix上的表示 ...

  6. Kafka性能之道

    Kafka高性能之道 高效使用磁盘 零拷贝 批处理和压缩 Partition ISR 高效使用磁盘 >顺序写cipan >Append Only(数据不更新,无记录级的数据删除,只会整个s ...

  7. BZOJ 1927 星际竞速(费用流)

    考虑费用流,题目要求走n个点都走完且恰好一次,显然流量的限制为n. 建立源点s和汇点t,并把每个星球拆成两个点i和i',分别表示已到达该点和经过该点. 对于能力爆发,建边(s,i',1,w). 对应高 ...

  8. 前端基础:CSS样式选择器

    前端基础:CSS样式选择器 CSS概述 CSS是Cascading Style Sheets的简称,中文意思是:层叠样式表,对html标签的渲染和布局.CSS规则由两个主要的部分组成:1.选择器:2. ...

  9. asp.net AES加密跟PHP的一致,将加密的2进制byte[]转换为16进制byte[] 的字符串获得

    <?php class AESUtil { public static function encrypt($input, $key) { $size = mcrypt_get_block_siz ...

  10. Django错误 OperationalError: no such column: xxx

    模型前后操作如下: 第一次迁移: class Snippet(models.Model): created = models.DateTimeField(auto_now_add=True) titl ...