#!/usr/bin/python # encoding:utf-8 import urllib2, json, urllib # 2、根据品牌获取所有车型 data = {} data["appkey"] = "your_appkey_here" data["parentid"] = 1 #品牌ID url_values = urllib.urlencode(data) url = "https://api.jisuapi.com/car/carlist" + "?" + url_values request = urllib2.Request(url) result = urllib2.urlopen(request) jsonarr = json.loads(result.read()) if jsonarr["status"] != u"0": print jsonarr["msg"] exit() result = jsonarr["result"] for val in result: print val["id"],val["name"],val["initial"],val["parentid"],val["depth"] #车子公司信息,2级 for v in val["carlist"]: print v["id"],v["name"],v["initial"],v["parentid"],v["depth"],v["fullname"],v["logo"],v["salestate"] #车信息,3级 if v.has_key("list"): for vv in v["list"]: print vv["id"],vv["name"],vv["initial"],vv["parentid"],vv["depth"],vv["salestate"],vv["price"],vv["yeartype"],vv["productionstate"],vv["sizetype"] #具体的每一款车,4级