首页 > 问答 > 正文
从网页中抓取到了一组字符如b'{"aa":11,"bb":22,"cc":33}'如何取出aa的值
三叔2016-10-22 16:35:02
用json里的loads
import json raw = b'{"aa":11,"bb":22,"cc":33}' d = json.loads(str(raw, 'utf-8')) print(d['aa'])