python的webservice请求
2020-12-13 03:33
标签:city time coding turn import sof arc from service python的webservice请求 标签:city time coding turn import sof arc from service 原文地址:https://www.cnblogs.com/xuzhongtao/p/11079845.html1.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‘))
下一篇:Json数据转换