ITeye博客

Python

共 1 篇文章

Python语法学习

import urllib import sys import xml.etree.ElementTree as etree def get_url_list(apiurl): xml_data = urllib.urlopen(apiurl).read() city_xml_data = etree.fromstring(xml_data) return list(city_xml_data.find("divisions").iter("division")) def get_shop_list(apiurl): xmldata = urllib.urlopen(apiurl).read…

2012-04-13 19:13 · Python