AQQ批量网站工具集之调用浏览器打开URL列表

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#! /usr/bin/env python
#coding=utf-8

# AQQ批量网站工具集之调用浏览器打开URL列表

# http://www.oschina.net/code/list_by_user?id=2008177
# http://my.oschina.net/bluefly/blog

import webbrowser
import time

print u'请输入文件名:'.encode('gb2312')
URLname = raw_input()

# attempt to open file for reading
try:
    fobj = open(URLname,'r')
except:
    print '*** file open error,Please check filename and try again!'
else:
    i = 0
    for eachUrl in fobj:
        eachUrl = eachUrl.strip()
        webbrowser.open(eachUrl)
        time.sleep(2)      #jiange  shijian
        i = i + 1
        if i % 5 == 0:       # each open url num
            raw_input("No %d " % i)