赞
踩
先爬取了微博评论网友的id
代码如下
import requests
url = ‘https://m.weibo.cn/api/comments/show?id=4188633986790962&page=6
h = requests.get(url)
print(h.json()[‘data‘][‘data‘][0][‘user‘][‘id‘])
执行的时候报错
Traceback (most recent call last):
File "e:/personal/vscode/pameinv.py", line 9, in
print(a())
File "e:/personal/vscode/pameinv.py", line 8, in a
return html.json()
File "D:\python\Python37\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "D:\python\Python37\lib\json__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "D:\python\Python37\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\python\Python37\lib\json\d
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。