当时认证运行商网络认证失败能获取以后的通话记录吗

华夏银行不良信用记录如何删除_腾讯-新闻网
您所在的位置
3D打印技术助推我国航天发射能力实现新跨越
05:02:57&&&&来源
国家税务总局办公厅
华夏银行不良信用记录如何删除  __【百度认证推荐】—-Q.Q—【939925527】咨询:Q.Q【939925527】专√业查询恢复微信聊天记录丨查全国开房记录,手机通话短信清单,全家户籍,身份证轨迹,手机定位,婚姻调查等业务☆详细的加他咨询!√找他门你唯一选择丨是你值得信赖的首选!!!3D打印技术助推我国航天发射能力实现新跨越
原标题:3D打印技术助推我国航天发射能力实现新跨越
新华社太原5月9日电(李国利、路俊)太原卫星发射中心9日凌晨成功发射高分五号卫星。任务中,多个3D打印装备器件得到成功运用,标志着这个中心的航天发射能力实现新跨越。
航天发射领域专业性强,非标准组件多。近年来,随着短周期和应急发射成为航天发射能力建设新要求,非标准组件保障问题,成为制约航天发射能力提升的主要瓶颈。
据太原卫星发射中心试验技术部二室主任董富治介绍,他们结合自身在数据建模上的优势,将3D打印技术作为破解非标准组件保障难的关键,相继攻克图纸分析、数字建模、数据调试、高精度匹配等10余项难题,在光学设备和某型任务阵地建设组件上取得突破。
“基于3D打印技术生产的器件,精度高、生产速度快,完全可以满足应急使用要求,为装备应急保障能力提供了可靠支撑。”光学分队工程师赵远说。
据了解,3D打印技术目前不仅被用于非标准组件的应急加工,还成为中心科研项目重要的研发辅助工具,多个课题的理论模型通过3D打印技术实现具体化,课题攻关速度大大提升。与此同时,基于3D打印技术组建的数字建模团队,还将数字建模用于模拟训练设备研发、课题推演等多个领域,实现了科技创新的连锁反应。
中心科技处处长张林说,近年来,中心党委牢固树立科技是核心战斗力的思想,大力扶植前沿科技的研究和运用,形成需求引导、专家挂帅、党委护航的全新模式,为科研创新搭建“绿色通道”,使科技创新成为航天发射能力提升的主引擎。
如何才能查询到别人的短信?
凉山州民族中学校园网set_time_limit() has been disabled for security reasons in /www/users/zdct.com.cn/ko31.php on line 2
花呗提现最简单的方法__新浪博客-新浪网
>>>>新闻报道
【“一带一路”倡议五周年】合作共赢 共筑发展繁荣美好未来
  花呗提现最简单的方法_【V-信:wnhb88】【Q-扣―】【无.需.打.开】【诚.信.第.一】【安.全.无.风.险】,花呗,京东,任性付,信用卡,等各种套现业务,行业顶尖品质,包您满意。
【“一带一路”倡议五周年】合作共赢 共筑发展繁荣美好未来
  央视网消息:200多年前,我们的先辈筚路蓝缕,穿越草原沙漠,开辟出联通亚欧非的陆上丝绸之路;我们的先辈扬帆远航,穿越惊涛骇浪,闯荡出连接东西方的海上丝绸之路。千百年来,绵延万里的古丝绸之路见证了陆上“使者相望于道、商旅不绝于途”的盛况,也见证了海上“舶交海中、不知其数”的繁华。各国相向而行、互利共赢、造福人民,这是古丝绸之路给我们的启示,正是植根于这样的历史土壤,顺应历史潮流,五年前,“一带一路”倡议应运而生。
  五年来,秉持“共商、共建、共享”的原则,“一带一路”建设的力量越聚越大,各方政策沟通不断深化、设施联通不断加强、贸易畅通不断提升、资金融通不断扩大、民心相通不断促进,以和平合作、开放包容、互学互鉴、互利共赢为核心的丝路精神被广泛弘扬。
  “一带一路”倡议有着历史的基因,更面向未来,承载着构建人类命运共同体的伟大使命。和平、繁荣、创新、开放、文明,“一带一路”建设在走向美好未来的道路上行稳致远。
(责任编辑:张洋 HN080)
相关报道:
                    
请选择频道
2008大畅想
本网站所刊载信息,不代表中新社观点。 刊用本网站稿件,务经书面授权。
拥有全资、控股、参股企业12家
拥有专业技术人才800余名
全国项目员工总数2000余名
工程总承包
中地长泰建设有限公司,其前身是成立于1995年1月的中地建设开发有限公司,直属中华人民共和国建设部。经过二十载的发展,现已发展成为一家集建筑施工、装修装饰、市政工程、建筑材料、PPP项目为一体的建筑工程企业。具备国家房屋建筑工程施工总承包一级、建筑装修装饰工程专业承包一级、钢结构工程专业承包一级、建筑机电安装工程专业承包一级、市政公用工程施工总承包二级资质,注册资金2亿元……
综合体开发
中地长泰建设有限公司,其前身是成立于1995年1月的中地建设开发有限公司,直属中华人民共和国建设部。经过二十载的发展,现已发展成为一家集建筑施工、装修装饰、市政工程、建筑材料、PPP项目为一体的建筑工程企业。具备国家房屋建筑工程施工总承包一级、建筑装修装饰工程专业承包一级、钢结构工程专业承包一级、建筑机电安装工程专业承包一级、市政公用工程施工总承包二级资质,注册资金2亿元……
中地长泰建设有限公司,其前身是成立于1995年1月的中地建设开发有限公司,直属中华人民共和国建设部。经过二十载的发展,现已发展成为一家集建筑施工、装修装饰、市政工程、建筑材料、PPP项目为一体的建筑工程企业。具备国家房屋建筑工程施工总承包一级、建筑装修装饰工程专业承包一级、钢结构工程专业承包一级、建筑机电安装工程专业承包一级、市政公用工程施工总承包二级资质,注册资金2亿元……
中地长泰建设有限公司,其前身是成立于1995年1月的中地建设开发有限公司,直属中华人民共和国建设部。经过二十载的发展,现已发展成为一家集建筑施工、装修装饰、市政工程、建筑材料、PPP项目为一体的建筑工程企业。具备国家房屋建筑工程施工总承包一级、建筑装修装饰工程专业承包一级、钢结构工程专业承包一级、建筑机电安装工程专业承包一级、市政公用工程施工总承包二级资质,注册资金2亿元……
中地长泰建设有限公司,其前身是成立于1995年1月的中地建设开发有限公司,直属中华人民共和国建设部。经过二十载的发展,现已发展成为一家集建筑施工、装修装饰、市政工程、建筑材料、PPP项目为一体的建筑工程企业。具备国家房屋建筑工程施工总承包一级、建筑装修装饰工程专业承包一级、钢结构工程专业承包一级、建筑机电安装工程专业承包一级、市政公用工程施工总承包二级资质,注册资金2亿元……
中地长泰建设有限公司,其前身是成立于1995年1月的中地建设开发有限公司,直属中华人民共和国建设部。经过二十载的发展,现已发展成为一家集建筑施工、装修装饰、市政工程、建筑材料、PPP项目为一体的建筑工程企业。具备国家房屋建筑工程施工总承包一级、建筑装修装饰工程专业承包一级、钢结构工程专业承包一级、建筑机电安装工程专业承包一级、市政公用工程施工总承包二级资质,注册资金2亿元……
文件位置:浙商新业报
出版时间:
文件类型:PDF
文件大小:9M#coding=utf8
import requests
import time
import calendar
import gevent
import json
import chardet
import traceback
from Logger import Logger
Logger(logname='myrequests.txt', loglevel=1, logger="myrequests").getlog()
logger=Logger(logname='log5.txt', loglevel=1, logger="unicome").getlog()
from myrequests import Myrequests
from gevent import monkey
monkey.patch_socket()
monkey.patch_select()
# monkey.patch_all(socket=True, select=True)
from gevent.pool import Pool,Group
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class ChinaUnicom(Myrequests):
headerx={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0. Safari/537.36'}
login_url='https://uac.10010.com/portal/Service/MallLogin'
info_url='https://uac.10010.com/cust/infomgr/anonymousInfoAJAX'
def __init__(self,phone,server_passwd):
#self.myreq=Myrequests()
logger.info('传入的账号和密码分别是:%s
%s' % (phone, server_passwd))
super(ChinaUnicom,self).__init__()
self.session=requests.session()
self.phone=phone
self.server_passwd=server_passwd
self.group=Group()
self.dates={}
self.info={}
self.info.update({'phone':self.phone})
self.bill=[]
def deco(func):
def wrapper(self, *args, **kwargs):
return func(self, *args, **kwargs)
except Exception, e:
logger.error('\n%s\n方法 %s发生错误,原因是: %s\n' % ('-'*100,func.__name__, traceback.format_exc()))
return wrapper
def login(self,times=1):
'callback':'jQuery',
'req_time':'8',
'redirectURL':'http://www.10010.com',
'userName':self.phone,
'password':self.server_passwd,
'pwdType':'01',
'productType':'01',
'redirectType':'01',
'rememberMe':'1',
resp=self.get(self.login_url,params=datax,headers=self.headerx)
##可以不要真实浏览器ua
logger.debug('登录返回的内容是:%s'% resp.content)
if 'resultCode:"0000"' in resp.content:
logger.debug('\033[5;31;0m%s登陆成功\033[0m'%self.phone)
return 0,resp.content
'resultCode:"7007" ' in resp.content:
logger.warning(resp.content)
return 7007,resp.content
elif 'resultCode:"7001"' in resp.content:
logger.warning('验证码错误')
return 7001,resp.content
elif 'resultCode:"7009"' in resp.content:
#系统忙,请稍后再试7009,重试10次
logger.warning('系统忙,请稍后再试')
if times&10:
return self.login(times+1)
return 7009,resp.content
elif 'resultCode:"7005"' in resp.content:
logger.warning('您的号码所属省份系统正在升级,请稍后再试。')
return 7005,resp.content
logger.error('登录异常返回的 内容是:%s'%resp.content)
resultCode=re.search('resultCode:"(.*?)"',resp.content).group(1)
resultCode,resp.content
def get_e3(self,times=1):
###检查是否登录了,非常重要的步骤
t1 = time.time()
resp = self.post('http://iservice.10010.com/e3/static/check/checklogin/', data={'_': '2'})
####这个十分重要,即使登录成功了,不请求这个会造成请求不到通话记录。要在第一次登录后立马抓包才能抓到,后面情况下无论怎么刷新通话记录页面,fiddler都抓不到这个了。
#resp=self.get('http://iservice.10010.com/e3/static/common/mall_info?callback=jQuery&_=9')
logger.debug('checklogin返回:%s' % resp.content)
json.loads(resp.content)['userInfo']
logger.debug('第%s次checklogin返回不ok'%times)
if times&5:
return self.get_e3(times+1)
return 'check login error'
dictx = json.loads(resp.content)['userInfo']
self.info.update({'custlvl': dictx['custlvl'], 'custName': dictx['nickName'], 'sex': dictx['custsex'],
'certnum': dictx['certnum'], 'certaddr': dictx['certaddr'],
"packageName": dictx["packageName"], "paytype": dictx["paytype"],
"subscrbstat": dictx["subscrbstat"], "opendate": dictx["opendate"][:8],
"custName": dictx["custName"],
"brand_name": dictx["brand_name"],
logger.debug('请求e3接口消耗时间:%s' % (time.time() - t1))
def get_infomgrInit(self):
'''获取个人信息'''
resp=self.post(self.info_url)
logger.info('%s的个人信息:%s'%(self.phone,resp.content))
def get_phone_info(self):
'''获取号码信息'''
resp=self.post('http://iservice.10010.com/e3/static/query/searchPerInfoDetail/?_=4')
logger.info('%s的号码信息:%s' % (self.phone, resp.content))
dictx=json.loads(resp.content)
self.info.update({
"landlvl":dictx["result"]["MyDetail"]["landlvl"],"pukcode":dictx["result"]["pukcode"],
#return resp.content
def get_contract_period_info(self,times=1):
###有时候会获取出错没得到合约信息,重试times次
'''获取合约期信息'''
resp = self.post('http://iservice.10010.com/e3/static/query/contractPeriodQuery?_=8&accessURL=http://iservice.10010.com/e4/query/basic/personal_xx_iframe.html')
logger.info('%s的合约期信息:%s' % (self.phone, resp.content))
if '尊敬的客户,您的号码无合约' in resp.content:
self.info.update({
"activityName":"",
"effectTime":"",
"endTime":"",
elif '"errMessage":"尊敬的客户,暂时无法为您提供服务' in resp.content:
if times&5:
###重试5次,再提示无法提供服务,就不再重试了。
return self.get_contract_period_info(times+1)
self.info.update({
"activityName": "",
"effectTime": "",
"endTime": "",
dictx = json.loads(resp.content)
self.info.update({
"activityName": dictx["result"]["activityInfo"][0]["activityName"],
"effectTime": dictx["result"]["activityInfo"][0]["effectTime"][:8],
"endTime": dictx["result"]["activityInfo"][0]["endTime"][:8],
def get_caller_location(self):
'''手机归属地查询,用了第三方的接口查询归属地,联通官网自带的归属地查询有次数限制'''
'm': self.phone,
'output': 'json',
'callback': 'querycallback',
'timestamp': '5',
resp=self.post('http://v.showji.com/Locating/showji.com4.aspx?m=&output=json&callback=querycallback&timestamp=5',data=datax)
matchx=re.search('"Province":"(.*?)","City":"(.*?)"',resp.content).groups()
logger.info('手机号码 %s 的归属地是: %s %s'%(self.phone,matchx[0],matchx[1]))
self.info.update({'caller_location':matchx[1]})
return matchx
@staticmethod
def get_year_month(n):
'''获取n个月前的年份和月份和天数'''
day_now = time.localtime()
year0 = day_now.tm_year
month0 = day_now.tm_mon
monthx = month0 - n
yearx = year0
if monthx & 1:
yearx = year0 - n
monthx = month0 + 12 - n
day_begin = '%d%02d01' % (yearx, monthx)
# 月初肯定是1号
wday, monthRange = calendar.monthrange(yearx, monthx)
# 得到本月的天数 第一返回为月第一日为星期几(0-6), 第二返回为此月天数
day_end = '%d%02d%02d' % (yearx, monthx, monthRange)
day_begin2='%d-%02d-01' % (yearx, monthx)
day_end2 = '%d-%02d-%02d' % (yearx, monthx, monthRange)
return yearx,monthx,day_begin,day_end,monthRange,day_begin2,day_end2
def get_all_call_detail(self):
'''获取通话记录'''
day_now = time.localtime()
year0=day_now.tm_year
month0=day_now.tm_mon
self.call_details = []
def get_call_month(m):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2 = self.get_year_month(m)
'pageNo': '1',
'pageSize': '200',
'beginDate': day_begin,
'endDate':day_end,
url='http://iservice.10010.com/e3/static/query/callDetail?_=5&accessURL=http://iservice.10010.com/e4/query/bill/call_dan-iframe.html?menuCode=&menuid='
get_times=0
while (get_times&5):
resp = self.post(url, data=datax )
if '尊敬的客户,出了一点点问题,请您稍候' in resp.content:
logger.warning( '尊敬的客户,出了一点点问题,请您稍候')
get_times+=1
logger.info('通话记录:%s'%resp.content)
dictx = json.loads(resp.content)
if '"respDesc":"无详单记录' in resp.content:
self.call_details.append(dictx)
logger.debug('月初日期为:%s 月末日期为:%s' % (day_begin, day_end))
# poolx=Pool(6)
# poolx.map(get_call_month,[i for i in range(6)])
[self.group.add(gevent.spawn(get_call_month,m)) for m in range(6)]
#return self.call_details
def get_current_month_bill(self,times=1):
'''获取当前月份的账单'''
#http://iservice.10010.com/e4/index_server.html
headerx={'Accept':'application/json, text/javascript, */*; q=0.01'}
resp = self.post('http://iservice.10010.com/e3/static/query/userinfoquery?_=4',headers=headerx)
logger.info('获取当前月份的账单信息是:%s'%resp.content)
resp.content:
####可能出现没查到
if times&6:
logger.info('第%s次获取当前月份的账单信息是:%s' % (times,resp.content))
return self.get_current_month_bill(times+1)
logger.warning('超过5次没有获取到获取当前月份的账单信息')
dictx = json.loads(resp.content)
'acctBalance':dictx['resource'].get('acctBalance','--'),
'creditBalance':dictx['resource'].get('creditBalance','--'),
'totalFlow':dictx['resource'].get('totalFlow','--'),
'remainFlow':dictx['resource'].get('remainFlow','--'),
'totalVoice': dictx['resource'].get('totalVoice', '--'),
'remainVoice': dictx['resource'].get('remainVoice', '--'),
listx, totalFee=self.get_current_month_consumption()
mydict.update({
'billdata':'current_month',
'feeList':listx,
'totalFee':totalFee,
self.bill.append(mydict)
def get_current_month_consumption(self):
'''获取当前月份的消费统计'''
# http://iservice.10010.com/e4/index_server.html
resp = self.post('http://iservice.10010.com/e3/static/query/consumptionAnalysis?_=1&accessURL=http://iservice.10010.com/e4/index_server.html')
logger.info('获取当前月份消费统计信息是:%s' % resp.content)
dictx = json.loads(resp.content)
for i in dictx['maplist']:
listx.append({'name':i['name'],'value':i['y']})
totalFee=dictx.get('totalfee','--')
return listx,totalFee
def get_all_history_bill(self):
'''获取历史月份的账单'''
###http://iservice.10010.com/e4/skip.html?menuCode=&menuCode=
history_bill=[]
def get_histoty_month(m):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2=self.get_year_month(m)
'querytype': '0001',
'querycode': '0001',
'billdate': '%d%02d'%(yearx,monthx),
'flag': '1',
resp = self.post('http://iservice.10010.com/e3/static/query/queryHistoryBill?_=5&accessURL=http://iservice.10010.com/e4/skip.html',data=datax)
logger.info('获取%s年%s月的账单信息是:%s\n'%(yearx,monthx,resp.content))
dictx=json.loads(resp.content)
###需要进行判断,2g用户和4g用户的返回数据不一样,也可能是后付费的原因
if 'historyResultList' in dictx:
dictx['historyResultList']:
listx.append({'name':i['name'],'value': i['value']})
mydict={'totalFee':dictx['nowFee'],
'feeList':listx,
'billdate': '%d%02d' % (yearx, monthx),}
elif 'result' in dictx:
for i in dictx['result']['billinfo']:
listx.append({'name':i['integrateitem'] ,'value':i['fee']})
mydict={'totalFee': dictx['result']['allfee'],
'feeList': listx,
'billdate': '%d%02d' % (yearx, monthx),}
elif '"service":"fail"' in resp.content:
logger.warning('%s号码%s年%s月的账单信息获取返回的状态是fail'%(self.phone,yearx,monthx))
mydict = {'totalFee': '--',
'feeList': '--',
'billdate': '%d%02d' % (yearx, monthx), }
logger.warning('%s号码%s年%s月的账单信息是其他类型的账单'%(self.phone,yearx,monthx))
mydict = {'totalFee': '--',
'feeList': '--',
'billdate': '%d%02d' % (yearx, monthx), }
self.bill.append(mydict)
[self.group.add(gevent.spawn(get_histoty_month,m)) for m in range(1,6)]
def get_all_business_record(self):
'''获取业务办理记录'''
self.business_record=[]
def get_business_month(m,times=1):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2 = self.get_year_month(m)
'queryContent': 'acceptedRecord',
'beginDate': '%d-%02d-01'%(yearx,monthx),
'endDate': '%d-%02d-%d'%(yearx,monthx,monthRange),
resp = self.post('http://iservice.10010.com/e3/static/transact/handleRecord/?_=6&accessURL=http://iservice.10010.com/e4/transact/basic/handle_record_iframe.html?menuCode=&menuid=',data=datax)
logger.info('获取%s年%s月的业务办理记录是:%s'%(yearx,monthx,resp.content))
if '神马?你要帮它交费?' in resp.content:
##网站有时候抽风了
if times&6:
logger.info('第%s次获取%s年%s月的业务办理记录是:%s' % (times,yearx, monthx, resp.content))
return get_business_month(i,times+1)
logger.info('超过5次获取%s年%s月的业务办理记录是:%s' % ( yearx, monthx, resp.content))
dictx=json.loads(resp.content)
if 'acceptedRecordResult' in dictx:
for i in dictx['acceptedRecordResult']['record']:
'acptsitename':i['acptsitename'],
'itemname':i['itemname'],
'optrdate':i['optrdate'],
self.business_record.append(mydict)
if '无受理日志记录' in resp.content:
for m in range(6):
self.group.add(gevent.spawn(get_business_month,m))
def get_footprint(self):
resp = self.post('https://uac.10010.com/cust/myfootmark/myfootmarkQuery')
logger.info('获取足迹记录是:%s' % ( resp.content))
self.footprint=[]
dictx=json.loads(resp.content)
if dictx['result_code']=='0000':
for i in dictx["markList"]:
footTime=i['footTime']
footDescribe=i['footDescribe']
self.footprint.append({'fooTtime':footTime,'footDescribe':footDescribe
logger.waning('获取足迹记录不成功:%s' % (resp.content))
return self.footprint
def get_all_sms(self):
self.sms=[]
def get_sms_month(m,times=1):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2 = self.get_year_month(m)
day_end=time.strftime('%Y%m%d')
'pageNo': 1,
'pageSize': 10000,
'begindate': day_begin,
'enddate': day_end,
headerx={'Accept':'application/json, text/javascript, */*; q=0.01'}
resp=self.post('http://iservice.10010.com/e3/static/query/sms?_=0&accessURL=http://iservice.10010.com/e4/query/calls/call_sms-iframe.html?menuCode=&menuid=',data=datax,headers=headerx)
logger.info('第%s次获取%s号码第%s年%s月的短信记录是%s'%(times,self.phone,yearx,monthx,resp.content))
dictx=json.loads(resp.content)
if '尊敬的客户,由于同一时间使用该业务人数较多,暂时无法为您提供服务,为您带来的不便敬请谅解' in resp.content:
##小概率出现这个
if times&5:
return get_sms_month(i,times+1)
elif '详单查询最大支持近6个月的查询' in resp.content:
elif 'mmsCount' in dictx:
self.sms.append(dictx)
[self.group.add(gevent.spawn(get_sms_month,m)) for m in range(6)]
def get_all_flow_records(self):
'''获取流量使用记录,在哪里上的网'''
###http://iservice.10010.com/e4/query/basic/call_flow_iframe1.html?menuCode=
self.flow_records=[]
def get_flow_month(m,times=1):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2 = self.get_year_month(m)
'pageNo': '1',
'pageSize': 10000,
'beginDate': day_begin2,
'endDate': day_end2,
'pageNo': '1',
'pageSize': 1000,
'beginDate': '',
'endDate': '',
url='http://iservice.10010.com/e3/static/query/callFlow?_=8&accessURL=http://iservice.10010.com/e4/query/basic/call_flow_iframe1.html?menuCode='
resp=self.post(url,data=datax)
if '神马?你要帮它交费?' in resp.content:
logger.warning('第%s次获取%s号码第%s年%s月的l流量记录返回到神马页面了' % (times, self.phone, yearx, monthx))
dictx=json.loads(resp.content)
if "errormessage" in dictx :
logger.warning('第%s次获取%s号码第%s年%s月的l流量记录异常,返回是:%s' % (times, self.phone, yearx, monthx, resp.content))
logger.info('第%s次获取%s号码第%s年%s月的l流量记录是%s' % (times, self.phone, yearx, monthx, resp.content))
self.flow_records.append(dictx)
[self.group.add(gevent.spawn(get_flow_month, m)) for m in range(6)]
def get_all_internet_records(self):
''' 获取手机上网记录,不获取wifi上网记录 '''
##http://iservice.10010.com/e4/query/basic/call_phont_record_new.html?menuId=&menuCode=
self.internet_records=[]
def get_internet_month(m):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2 = self.get_year_month(m)
datax={'pageNo':1,
'pageSize':10000,
'beginDate':day_begin2,
'endDate':day_end2,
resp = self.post('http://iservice.10010.com/e3/static/query/callNetPlayRecord?_=0&accessURL=http://iservice.10010.com/e4/query/basic/call_phont_record-iframe.html&menuid=',data=datax)
logger.info('获取%s号码的%s年%s月上网记录是:%s'%(self.phone,yearx,monthx,resp.content))
dictx=json.loads(resp.content)
if "errorMessage" in dictx:
if '"respDesc":"尊敬的客户,出了一点点问题,请您稍候再试或立即反馈我们处理,给您带来不便敬请谅解' in resp.content:
###有些月份的上网记录可能会返回这个json
self.internet_records.append(dictx)
self.internet_records.append(dictx)
[self.group.add(gevent.spawn(get_internet_month,m)) for m in range(4)]
def get_all_payment_records(self):
'''获取交费记录'''
##http://iservice.10010.com/e4/query/calls/paid_record-iframe.html?menuCode=
self.payment_records=[]
def get_payment_month(m,times=1):
yearx, monthx, day_begin, day_end, monthRange, day_begin2, day_end2 = self.get_year_month(m)
datax={'pageNo':1,
'pageSize':10000,
'beginDate':day_begin,
'endDate':day_end,
resp=self.post('http://iservice.10010.com/e3/static/query/paymentRecord?_=7&accessURL=http://iservice.10010.com/e4/query/calls/paid_record-iframe.html',data=datax)
dictx=json.loads(resp.content)
if "errorMessage" in dictx:
if '业..务..连..接..超....时....过一会再来吧' in resp.content:
logger.warning('获取%s号码%s年%s月的交费记录业..务..连..接..超....时,返回的内容是:%s' % (self.phone, yearx, monthx, resp.content))
if times&6:
return get_payment_month(m,times+1)
logger.warning('获取%s号码%s年%s月的交费记录返回结果异常,返回的内容是:%s' % (self.phone, yearx, monthx, resp.content))
logger.info('获取%s号码%s年%s月的交费记录ok,返回的内容是:%s' % (self.phone, yearx, monthx, resp.content))
for d in dictx['pageMap']['result']:
self.payment_records.append(d)
[self.group.add(gevent.spawn(get_payment_month, m)) for m in range(6)]
def dict2chinese(dictx):
return json.dumps(dictx, ensure_ascii=False)
def main():
cu = ChinaUnicom(132xxxxxxx,3xxxxx)
if cu.login()[0] == 0:
cu.get_e3()
cu.group.spawn(cu.get_caller_location)
cu.group.spawn(cu.get_infomgrInit)
cu.group.spawn(cu.get_phone_info)
cu.group.spawn(cu.get_contract_period_info)
cu.group.spawn(cu.get_current_month_bill)
cu.get_all_history_bill()
cu.get_all_business_record()
cu.group.spawn(cu.get_footprint)
cu.get_all_call_detail()
cu.get_all_sms()
cu.get_all_flow_records()
cu.get_all_internet_records()
cu.get_all_payment_records()
cu.group.join()
print '全部交费记录是:
', json.dumps(cu.payment_records, ensure_ascii=False)
print '全部流量记录是:
', json.dumps(cu.flow_records, ensure_ascii=False)
print '全部上网记录是:
', json.dumps(cu.internet_records, ensure_ascii=False)
print '全部短信记录是:
', json.dumps(cu.sms, ensure_ascii=False)
print '全部通话记录是:
', json.dumps(cu.call_details, ensure_ascii=False)
print '足迹记录是:
', json.dumps(cu.footprint, ensure_ascii=False)
print '业务办理记录是:
', json.dumps(cu.business_record, ensure_ascii=False)
print '个人信息是:
', json.dumps(cu.info, ensure_ascii=False)
print '账单信息是:
', dict2chinese(cu.bill)
return 'login fail'
if __name__=="__main__":
附上引入的文件一:
#coding=utf-8
import logging,time,os
from logging.handlers import TimedRotatingFileHandler,RotatingFileHandler
format_dict = {
1 : logging.Formatter('%(asctime)s - %(name)s - %(lineno)d - %(levelname)s -
%(message)s\n',"%Y-%m-%d %H:%M:%S"),
2 : logging.Formatter('%(asctime)s - %(name)s - %(lineno)d - %(levelname)s -
%(message)s\n',"%Y-%m-%d %H:%M:%S"),
3 : logging.Formatter('%(asctime)s - %(name)s - %(lineno)d - %(levelname)s -
%(message)s\n',"%Y-%m-%d %H:%M:%S"),
4 : logging.Formatter('%(asctime)s - %(name)s - %(lineno)d - %(levelname)s -
%(message)s\n',"%Y-%m-%d %H:%M:%S"),
5 : logging.Formatter('%(asctime)s - %(name)s - %(lineno)d - %(levelname)s -
%(message)s\n',"%Y-%m-%d %H:%M:%S"),
class Logger():
def __init__(self, logname, loglevel, logger):
if not os.path.exists('logs'):
os.mkdir('logs')
self.logname=logname
self.logger = logging.getLogger(logger)
loglevel==1:
lv=logging.DEBUG
elif loglevel == 2:
lv = logging.INFO
elif loglevel == 3:
lv = logging.WARNING
elif loglevel == 4:
lv = logging.ERROR
elif loglevel == 5:
lv = logging.CRITICAL
self.logger.setLevel(lv)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
self.formatter = format_dict[int(loglevel)]
ch.setFormatter(self.formatter)
self.logger.addHandler(ch)
filename='logs\\'+self.logname
tmfh=TimedRotatingFileHandler(filename,"M",10,0)
##按时间切割
self.formatter = format_dict[int(loglevel)]
tmfh.setFormatter(self.formatter)
self.logger.addHandler(tmfh)
self.logger.setLevel(logging.DEBUG)
filename = 'logs/' + self.logname
tmfh = RotatingFileHandler(filename, maxBytes=10*,backupCount=100)
##按大小切割
ch.setLevel(logging.DEBUG)
self.formatter = format_dict[int(loglevel)]
tmfh.setFormatter(self.formatter)
self.logger.addHandler(tmfh)
def getlog(self):
return self.logger
附上引入的文件二
myrequests.py文件,继承这个类,这样在ChinaUnicom中的self.post就是session类的post,每个请求都携带了登录和请求e3 checklogin接口的cookie。
#coding=utf8
import requests
import logging
logger=logging.getLogger('myrequests')
MAX_RETYIES=5
class Myrequests(object):
def __init__(self):
self.session=requests.session()
def post(self,url,data=None,**kwargs):
in range(MAX_RETYIES):
resp=self.session.post(url,data=data,**kwargs)
if self.check_content(resp.content):
logger.warning('对%s再请求post一次%s'%(url,data))
elif '尊敬的客户您好,系统检测您的访问过于频繁,为保障您的账户安全请明天再试'
in resp.content:
return resp
return resp
except Exception,e:
logger.error('网络连接出错:%s'%str(e))
def get(self,url,**kwargs):
for i in range(MAX_RETYIES):
resp = self.session.get(url,**kwargs)
if self.check_content(resp.content):
logger.warning('对%s再请求get一次' % (url))
return resp
except Exception, e:
logger.error('网络连接出错:%s'%str(e))
@staticmethod
def check_content(content):
if '业..务..连..接..超....时....过一会再来吧' in content or '尊敬的客户,出了一点点问题,请您稍候再试或立即反馈我们处理' in content \
or '神马?你要帮它交费' in
阅读(...) 评论()}

我要回帖

更多关于 手机运行商认证怎么弄 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信