python在律师上作中的实例_基于Python的律师信息查询接口调用代码实例

《基于Python的律师信息查询接口调用代码实例》由会员分享,可在线阅读,更多相关《基于Python的律师信息查询接口调用代码实例(10页珍藏版)》请在人人文库网上搜索。

1、基于Python的律师信息查询接口调用代码实例代码描述:基于Python的律师信息查询接口调用代码实例代码平台:聚合数据#!/usr/bin/python# -*- coding: utf-8 -*-import json, urllibfrom urllib import urlencode#-# 律师查询调用示例代码 聚合数据# 在线接口文档:http:/www.juhe.cn/docs/83#-def main():#配置您申请的APPKeyappkey = *#1.按省份查询律师request1(appkey,GET)#2.按城市查询律师request2(appkey,GET)#3.按。

2、相似姓名查询律师request3(appkey,GET)#4.按专长领域查询律师request4(appkey,GET)#5.随机查询律师request5(appkey,GET)#6.按手机号码查询律师request6(appkey,GET)#7.由省份查询城市request7(appkey,GET)#8.查询专业领域request8(appkey,GET)#9.查询省份列表request9(appkey,GET)#10.按姓名查询律师辩词request10(appkey,GET)#11.按关键词查询律师辩词request11(appkey,GET)#12.随机查询律师辩词request12(。

3、appkey,GET)#按省份查询律师def request1(appkey, m=GET):url = http:/op.juhe.cn/lawyers/proparams = dtype : , #返回的数据格式,json或xmlst : , #开始数count : , #返回的个数pro : , #省份名字,如:江苏key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url。

4、, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#按城市查询律师def request2(appkey, m=GET):url = http:/op.juhe.cn/lawyers/cityparams = dtype : , #返回的数据格式,json或x。

5、mlst : , #开始数count : , #返回的个数city : , #城市名字,如:苏州key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print 。

6、resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#按相似姓名查询律师def request3(appkey, m=GET):url = http:/op.juhe.cn/lawyers/nameparams = dtype : , #返回的数据格式,json或xmlst : , #开始数count : , #返回的个数name : , #要查询的名字,如:张三、张、安等(模糊查询)key : appkey, #您申请的AppKey,请在应用详细页查询params = urlenco。

7、de(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#按专长领域查询律师def requ。

8、est4(appkey, m=GET):url = http:/op.juhe.cn/lawyers/specparams = dtype : , #返回的数据格式,json或xmlst : , #开始数count : , #返回的个数spec : , #专长领域key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res。

9、 = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#随机查询律师def request5(appkey, m=GET):url = http:/op.juhe.cn/lawyers/randparams = dtype : , #返回的数据格式,json或xmlcount : , #返回的个数key : appkey,。

10、 #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:pri。

11、nt request api error#按手机号码查询律师def request6(appkey, m=GET):url = http:/op.juhe.cn/lawyers/mobileparams = dtype : , #返回的数据格式,json或xmlst : , #开始数count : , #返回的个数mobile : , #手机号码key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib。

12、.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#由省份查询城市def request7(appkey, m=GET):url = http:/op.juhe.cn/lawyers/citiesByProparams = dtype 。

13、: , #返回的数据格式,json或xmlpro : , #省份,如:江苏key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultel。

14、se:print %s:%s % (reserror_code,resreason)else:print request api error#查询专业领域def request8(appkey, m=GET):url = http:/op.juhe.cn/lawyers/specsparams = dtype : , #返回的数据格式,json或xmlkey : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = url。

15、lib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#查询省份列表def request9(appkey, m=GET):url = http:/op.juhe.cn/lawyers/prosparams = dtype : , #。

16、返回的数据格式,json或xmlkey : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (res。

17、error_code,resreason)else:print request api error#按姓名查询律师辩词def request10(appkey, m=GET):url = http:/op.juhe.cn/lawyers/argsByNameparams = dtype : , #返回的数据格式,json或xmlst : , #开始数count : , #返回的个数name : , #律师姓名key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%。

18、s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#按关键词查询律师辩词def request11(appkey, m=GET):url = http:/op.juhe.c。

19、n/lawyers/argsByTermparams = dtype : , #返回的数据格式,json或xmlst : , #开始数count : , #返回的个数term : , #关键词key : appkey, #您申请的AppKey,请在应用详细页查询params = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_c。

20、ode = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api error#随机查询律师辩词def request12(appkey, m=GET):url = http:/op.juhe.cn/lawyers/argsByRandparams = dtype : , #返回的数据格式,json或xmlcount : , #返回的个数key : appkey, #您申请的AppKey,请在应用详细页查询param。

21、s = urlencode(params)if m =GET:f = urllib.urlopen(%s?%s % (url, params)else:f = urllib.urlopen(url, params)content = f.read()res = json.loads(content)if res:error_code = reserror_codeif error_code = 0:#成功请求print resresultelse:print %s:%s % (reserror_code,resreason)else:print request api errorif __name__ = __main__:main(。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值