Python如果调用WebService?
如题,我在网上找了好久,说的都不是很明白,求大神指教
小弟刚刚学,讲解要一步一步来,谢谢啦~~
[解决办法]
links
第四个结果是抓取天气预报的:
#!/usr/bin/env python#coding=utf-8import urlliburl=u"http://www.webxml.com.cn/webservices/weatherwebservice.asmx/getWeatherbyCityName?theCityName=青岛"#打开urlpage=urllib.urlopen(url.encode('utf-8'))#读取body=page.readlines()page.close()#循环打印for line in body: print line