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‘))
原文:https://www.cnblogs.com/xuzhongtao/p/11079845.html