- # -*- coding: utf-8 -*-
- #---------------------------------------
- # 程序:百度贴吧爬虫
- # 版本:0.1
- # 作者:why
- # 日期:2013-05-14
- # 语言:Python 2.7
- # 操作:输入带分页的地址,去掉最后面的数字,设置一下起始页数和终点页数。
- # 功能:下载对应页码内的所有页面并存储为html文件。
- #---------------------------------------
- import string, urllib2
- #定义百度函数
- def baidu_tieba(url,begin_page,end_page):
- for i in range(begin_page, end_page+1):
- sName = string.zfill(i,5) + '.html'#自动填充成六位的文件名
- print '正在下载第' + str(i) + '个网页,并将其存储为' + sName + '......'
- f = open(sName,'w+')
- m = urllib2.urlopen(url + str(i)).read()
- f.write(m)
- f.close()
- #-------- 在这里输入参数 ------------------
- # 这个是山东大学的百度贴吧中某一个帖子的地址
- #bdurl = 'http://tieba.baidu.com/p/2296017831?pn='
- #iPostBegin = 1
- #iPostEnd = 10
- bdurl = str(raw_input(u'请输入贴吧的地址,去掉pn=后面的数字:\n'))
- begin_page = int(raw_input(u'请输入开始的页数:\n'))
- end_page = int(raw_input(u'请输入终点的页数:\n'))
- #-------- 在这里输入参数 ------------------
- #调用
- baidu_tieba(bdurl,begin_page,end_page)
- 本文已收录于以下专栏:
- Python爬虫入门教程
Do you need to increase your credit score?
回复删除Do you intend to upgrade your school grade?
Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
Do you need any information concerning any database.
Do you need to retrieve deleted files?
Do you need to clear your criminal records or DMV?
Do you want to remove any site or link from any blog?
you should contact this hacker, he is reliable and good at the hack jobs..
contact : cybergoldenhacker at gmail dot com
I can’t say much but with my experience through divorce, I had no one until I met hackingsetting50@gmail.com online then I contacted him, surprisingly he helped me hack into my partner's phone and all his social media platforms and i can now access everything and even documented and printed stuffs to show as evidence , now I’m happy with my kids and working for Riches. I hope this helps anyone in need.
回复删除Thanks.