首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

Python如果调用WebService?解决思路

2012-02-04 
Python如果调用WebService?如题,我在网上找了好久,说的都不是很明白,求大神指教小弟刚刚学,讲解要一步一步

Python如果调用WebService?
如题,我在网上找了好久,说的都不是很明白,求大神指教

小弟刚刚学,讲解要一步一步来,谢谢啦~~

[解决办法]
links

第四个结果是抓取天气预报的:

Python code
#!/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 

热点排行