当前位置:   article > 正文

python爬取直播礼物信息_python爬取主播信息

return complexjson.loads(self.text, **kwargs)

先爬取了微博评论网友的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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/357747
推荐阅读
相关标签
  

闽ICP备14008679号