{"code":"0","msg":"","res":{"topic":[],"page":"1","skip":"0","total":"0","list":[
{"tid":"12242860","title":"[抢完]C++ Enum","lastuid":"7530945","lastposter":"aduw","avatar":"https://baidu.com/s/tqxu.png","replies":"7","lastpost":"1523102297","isread":"0","helpcredit":"0","url":"zyj://3D12242860%26_tpl%3Dapp%26target%3D1","timages":[]},
{"tid":"12242847","title":"[抢完]Python List","lastuid":"7963672","lastposter":"aduw","avatar":"https://baidu.com/s/tqxu.png","replies":"11","lastpost":"1523102180","isread":"0","helpcredit":"0","url":"zyj://3Dapp%26target%3D1","timages":[]},
{"tid":"12242844","title":"[抢完]Java Final","lastuid":"1858970","lastposter":"aduw","avatar":"https://baidu.com/s/tqxu.png","replies":"34","lastpost":"1523102780","isread":"0","helpcredit":"0","url":"zyj://3Dapp%26target%3D1","timages":[]}]}
上面是客户端抓包的结果,想提取其中'title','tid'字段
使用 req.json()似乎会把汉字变成 unicode 编码,导致看起来很奇怪
试过 js_data['tid']['title'] 好像报错
试过 BS4,但是 parse 的使用需要指定 html/css/js 试了下 html 似乎不行?
Python 小白,还请各路大神指教
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.