Python@TW: 會眾| IRC| Planet| 郵件列表| 聯絡我們

import json from urllib.request import urlopen url = "https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?alt=json" response = urlopen(url) contents = response.read() text = contents.decode('utf8') data = json.loads(text) for video in data['feed']['entry'][0:6]: