python3+PAM30,刷新小工具

闲着无聊,写了个刷新的小工具,原本是用来替室友刷帖用的,后来发现那个论坛原来不是完全按照访问量来推荐帖子的,然后就悲剧了。

#! /usr/bin/env python #coding=utf-8 import urllib.request import time import random from PAM30 import PAMIE ie = PAMIE() ie.navigate('http://www.cc98.org/dispbbs.asp?boardID=100&ID=3802411') times=0 while times < 20: time.sleep(1) """ time.sleep(random.randint(3,5)) ie.closeWindow() ie.navigate('http://www.cc98.org/dispbbs.asp?boardID=100&ID=3802411') """ ie.refresh() times+=1 print("refresh %d times" %(times))
这个需要PAM30的模块, 他能让你如同写JS一样来操作IE浏览器。包括自动启动,访问链接,设置文本框值,获取按钮,执行点击事件,甚至执行页面JS方法等等。

主页http://pamie.sourceforge.net/

下载地址:http://sourceforge.net/projects/pamie/files/

下载后把.py的模块都拷贝到与源文件相同的目录下。

还要安装pywin,这个是phthon的windows拓展

下载地址:http://sourceforge.net/projects/pywin32/files/


更多内容

http://blog.sina.com.cn/s/blog_62c02a630100m3ue.html

http://www.juziblog.com/?p=237001


转载于:https://www.cnblogs.com/moiyer/archive/2011/11/06/2316155.html

猜你喜欢

转载自blog.csdn.net/weixin_34343689/article/details/94693176