账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    返回的数据异常,无法理解,无思路,经验不足,请看代码,谢谢!
    67
    0
    import requests
    url = 'https://www.zhihu.com/people/kaifulee/activities'
    headers = {
      'authorization': 'oauth c3cef7c66a1843f8b3a9e6a1e3160e20',
      'accept': 'application/json, text/plain, */*',
      'accept-encoding': 'deflate, br',
      'accept-language': 'zh-CN,zh;q=0.9',
      'referer': 'https://www.zhihu.com/people/tan-shi-san-57/following',
      'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
      'x-udid': 'AIBCI1Wl0gyPTn67_E1wN4NxZ3rOI2offMM=',
    
    }
    
    r = requests.get(url, headers=headers)
    print(r.headers['content-type'], r.encoding)
    print(r.text)
    

    打印部分输出:

    text/html; charset=utf-8 utf-8
    ȣ?�Z��=�j�t yrb.@�m�5&H疦�6���Mj��y��������IР�����3���ĢtA5S�!���W���f�ր�ef�R����BX5��p:���s�p��5A-�K�!$�xr�
    � ~�2t���%C�ӝ���p7|��GA��6w����);�pՍ��~��8�֭�;8�ᒽ8�Ya�������z������L�qX�KN�����$Ad�Q0H�f�RY-�� V��huZ&JP�<�5�5+��������$R� ��)T�>�2TAi��C�ö{y��,�v)�M�.�7q���9�3Aͅ�����@��5��b>����5G�%sR��2o���@����o��4P��`��s���LjmL���1=?���5�9�(�� }���s/ Qe�ml�����Ɣ}�s�����Tr"�>?�

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • -空白ゝ 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部