1.下载库:https://pypi.python.org/pypi/suds-jurko
2.解压后,进入到解压目录,安装库:python3 setup.py install
3.测试获取手机归属地,先获取方法
from suds.client import Client url = 'http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl' client = Client(url) print(client)
4.使用方法getMobileCodeInfo,这里随便输入一个手机号来测试
from suds.client import Client url = 'http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl' client = Client(url) # print(client) res = client.service.getMobileCodeInfo(13888888888) print(res)