python的webservice请求

2020-12-13 03:33

阅读:635

标签:city   time   coding   turn   import   sof   arc   from   service   

1.pip install client

2.pip install suds-jurko

#coding=utf-8
from suds.client import Client
import time
url=‘http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl‘
client = Client(url)
def get_methods_name():
method_list=[]
for i in client.wsdl.services[0].ports[0].methods:
method_list.append(i)
return method_list
for i in get_methods_name():
print(i)
time.sleep(5)
func=getattr(client.service,i)
print(func(‘221.112.223.1‘))
# print(client.service.getCountryCityByIp(theIpAddress=‘221.112.223.1‘))

python的webservice请求

标签:city   time   coding   turn   import   sof   arc   from   service   

原文地址:https://www.cnblogs.com/xuzhongtao/p/11079845.html


评论


亲,登录后才可以留言!