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. defineporperty 的使用 设置对象的只读或只写属性

    <!DOCTYPE html> <html lang="en"> <head> <title>Document</title& ...

  2. eg_1

    1. 编写一个程序,输出一个字符串中的大写英文字母个数,小写英文字母个数以及非英文字母个数. 第一种方法: public class Test { public static void main(St ...

  3. 【Linux】- ps -ef |grep 命令

    ps:将某个进程显示出来 grep:查找 |:管道命令 表示ps命令与grep同时执行 PS是LINUX下最常用的也是非常强大的进程查看命令 grep命令是查找,是一种强大的文本搜索工具,它能使用正则 ...

  4. python 爬虫每天定时启动爬虫任务

     # coding=utf-8 import datetime import time def doSth(): # 这里是执行爬虫的main程序     print '爬虫要开始运转了....'   ...

  5. 深入学习 Redis系列

    深入学习 Redis(1):Redis 内存模型 深入学习 Redis(2):持久化 深入学习 Redis(3):主从复制 深入学习 Redis(4):哨兵

  6. 第46天:setInterval与setTimeout的区别

    js的setTimeout方法用处比较多,通常用在页面刷新了.延迟执行了等等.今天对js的setTimeout方法做一个系统地总结. setInterval与setTimeout的区别 说道setTi ...

  7. 关联容器 // append方法

    关联容器和顺序容器的差别在于:关联容器通过键(key)存储和读取元素,而顺序容器则通过元素在容器中的位置顺序存储和访问元素. 1.关联容器支持通过键来高效地查找和读取元素.两个基本的关联容器类型是ma ...

  8. FZU 1492 地震预测(链表)

    实际上把数组排序一遍加入链表中,再记录好数组原来的数在链表中的位置.我们只需要维护链表的删除操作就可以了. # include <cstdio> # include <cstring ...

  9. Python logging(日志)模块

    python日志模块 内容简介 1.日志相关概念 2.logging模块简介 3.logging模块函数使用 4.logging模块日志流处理流程 5.logging模块组件使用 6.logging配 ...

  10. 【原创】Oracle Not In 导致有存在Null的数据被过滤

    解决方法:  WHERE  NVL(ID,)  NOT IN ('') 注:红字部分不相等就可以