import requests,json
response_json =requests.get('https://weibo.com/ajax/profile/info?uid=1810032213').text
json.loads(response_json)
JSONDecodeError Traceback (most recent call last)
<ipython-input-1-8966098e9114> in <module>
1 import requests,json
2 response_json =requests.get('https://weibo.com/ajax/profile/info?uid=1810032213').text
----> 3 json.loads(response_json)
D:\Ananaconda\lib\json\__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
355 parse_int is None and parse_float is None and
356 parse_constant is None and object_pairs_hook is None and not kw):
--> 357 return _default_decoder.decode(s)
358 if cls is None:
359 cls = JSONDecoder
D:\Ananaconda\lib\json\decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):
D:\Ananaconda\lib\json\decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
——————————————————
这里request到的,text:
<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv="Content-type" content="text/html; charset=gb2312"/>\n <title>Sina Visitor System</title>\n</head>\n<body>\n<span id="message"></span>\n<script type="text/javascript" src="/js/visitor/mini_original.js?v=20161116"></script>\n<script type="text/javascript">\n window.use_fp = "1" == "1"; // ÊÇ·ñ²É¼¯É豸ָÎÆ¡£\n var url = url || {};\n (function () {\n this.l = function (u, c) {\n try {\n var s = document.createElement("script");\n s.type = "text/javascript";\n s[document.all ? "onreadystatechange" : "onload"] = function () {\n\n if (document.all && this.readyState != "loaded" && this.readyState != "complete") {\n return\n }\n this[document.all ? "onreadystatechange" : "onload"] = null;\n this.parentNode.removeChild(this);\n if (c) {\n c()\n }\n };\n s.src = u;\n document.getElementsByTagName("head")[0].appendChild(s)\n } catch (e) {\n }\n };\n }).call(url);\n\n // Á÷³ÌÈë¿Ú¡£\n wload(function () {\n\n try {\n\n var need_restore = "1" == "1"; // ÊÇ·ñ×߻ָ´Éí·ÝÁ÷³Ì¡£\n\n // Èç¹ûÐèÒª×߻ָ´Éí·ÝÁ÷³Ì£¬³¢ÊÔ´Ó cookie »ñÈ¡Óû§Éí·Ý¡£\n if (!need_restore || !Store.CookieHelper.get("SRF")) {\n\n // Èô»ñȡʧ°Ü×ß´´½¨·Ã¿ÍÁ÷³Ì¡£\n // Á÷³ÌÖ´ÐÐʱ¼ä¹ý³¤£¨³¬¹ý 3s£©£¬ÔòÈÏΪ³ö´í¡£\n var error_timeout = window.setTimeout("error_back()", 5000);\n\n tid.get(function (tid, where, confidence) {\n // È¡Ö¸ÎÆ˳ÀûÍê³É£¬Çå³ý³ö´í timeout ¡£\n window.clearTimeout(error_timeout);\n incarnate(tid, where, confidence);\n });\n } else {\n // Óû§Éí·Ý´æÔÚ£¬³¢ÊÔ»Ö¸´Óû§Éí·Ý¡£\n restore();\n }\n } catch (e) {\n // ³ö´í¡£\n error_back();\n }\n });\n\n // ¡°·µ»Ø¡± »Øµ÷º¯Êý¡£\n var return_back = function (response) {\n\n if (response["retcode"] == 20000000) {\n back();\n } else {\n // ³ö´í¡£\n error_back(response["msg"]);\n }\n };\n\n // Ìøת»Ø³õʼµØÖ·¡£\n var back = function() {\n\n var url = "https://weibo.com/ajax/profile/info?uid=1810032213";\n if (url != "none") {\n window.location.href = url;\n }\n };\n\n // ¿çÓò¹ã²¥¡£\n var cross_domain = function (response) {\n\n var from = "weibo";\n var entry = "sinawap";\n if (response["retcode"] == 20000000) {\n\n var crossdomain_host = "login.sina.com.cn";\n if (crossdomain_host != "none") {\n\n var cross_domain_intr = window.location.protocol + "//" + crossdomain_host + "/visitor/visitor?a=crossdomain&cb=return_back&s=" +\n encodeURIComponent(response["data"]["sub"]) + "&sp=" + encodeURIComponent(response["data"]["subp"]) + "&from=" + from + "&_rand=" + Math.random() + "&entry=" + entry;\n url.l(cross_domain_intr);\n } else {\n\n back();\n }\n } else {\n\n // ³ö´í¡£\n error_back(response["msg"]);\n }\n };\n\n // ΪÓû§¸³Óè·Ã¿ÍÉí·Ý ¡£\n var incarnate = function (tid, where, conficence) {\n\n var gen_conf = "";\n var from = "weibo";\n var incarnate_intr = window.location.protocol + "//" + window.location.host + "/visitor/visitor?a=incarnate&t=" +\n encodeURIComponent(tid) + "&w=" + encodeURIComponent(where) + "&c=" + encodeURIComponent(conficence) +\n "&gc=" + encodeURIComponent(gen_conf) + "&cb=cross_domain&from=" + from + "&_rand=" + Math.random();\n url.l(incarnate_intr);\n };\n\n // »Ö¸´Óû§¶ªÊ§µÄÉí·Ý¡£\n var restore = function () {\n\n var from = "weibo";\n var restore_intr = window.location.protocol + "//" + window.location.host +\n "/visitor/visitor?a=restore&cb=restore_back&from=" + from + "&_rand=" + Math.random();\n\n url.l(restore_intr);\n };\n\n // ¿çÓò»Ö¸´¶ªÊ§µÄÉí·Ý¡£\n var restore_back = function (response) {\n\n // Éí·Ý»Ö¸´³É¹¦×߹㲥Á÷³Ì£¬·ñÔò×ß´´½¨·Ã¿ÍÁ÷³Ì¡£\n if (response["retcode"] == 20000000) {\n\n var url = "https://weibo.com/ajax/profile/info?uid=1810032213";\n var alt = response["data"]["alt"];\n var savestate = response["data"]["savestate"];\n if (alt != "") {\n requrl = (url == "none") ? "" : "&url=" + encodeURIComponent(url);\n var params = "entry=sso&alt=" + encodeURIComponent(alt) + "&returntype=META" +\n "&gateway=1&savestate=" + encodeURIComponent(savestate) + requrl;\n window.location.href = "https://login.sina.com.cn/sso/login.php?" + params;\n } else {\n\n cross_domain(response);\n }\n } else if(response[\'retcode\'] == 50111261 && isInIframe()) {\n //do nothing\n } else {\n\n tid.get(function (tid, where, confidence) {\n incarnate(tid, where, confidence);\n });\n }\n };\n\n // ³ö´íÇé¿ö·µ»ØµÇ¼ҳ¡£\n var error_back = function (msg) {\n\n var url = "https://weibo.com/ajax/profile/info?uid=1810032213";\n var clientType = "mobile";\n if (url != "none") {\n\n if (url.indexOf("ssovie4c55=0") === -1) {\n url += (((url.indexOf("?") === -1) ? "?" : "&") + "ssovie4c55=0");\n }\n if (clientType == "mobile") {\n \twindow.location.href = "https://passport.weibo.cn/signin/login?r="+url;\n } else{\n \twindow.location.href = "https://weibo.com/login.php";\n }\n } else {\n\n if(document.getElementById("message")) {\n document.getElementById("message").innerHTML = "Error occurred" + (msg ? (": " + msg) : ".");\n }\n }\n };\n\n var isInIframe = function () {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n };\n\n</script>\n</body>\n</html>'
{"ok":1,"data":{"user":{"id":1810032213,"idstr":"1810032213","pc_new":7,"screen_name":"荆雪莉rA24","profile_image_url":"https://tvax1.sinaimg.cn/crop.0.0.1002.1002.50/6be2e655ly8gb2r8itwezj20ru0ruq47.jpg?KID=imgbed,tva&Expires=1635580428&ssig=Ruqs%2B1ewC8","profile_url":"/u/1810032213","verified":false,"verified_type":-1,"domain":"","weihao":"","avatar_large":"https://tvax1.sinaimg.cn/crop.0.0.1002.1002.180/6be2e655ly8gb2r8itwezj20ru0ruq47.jpg?KID=imgbed,tva&Expires=1635580428&ssig=iSAW%2BSuFMM","avatar_hd":"https://tvax1.sinaimg.cn/crop.0.0.1002.1002.1024/6be2e655ly8gb2r8itwezj20ru0ruq47.jpg?KID=imgbed,tva&Expires=1635580428&ssig=gRQQp1M62p","follow_me":false,"following":false,"mbrank":0,"mbtype":0,"planet_video":true,"description":"","location":"四川 自贡","gender":"m","followers_count":22,"followers_count_str":"22","friends_count":513,"statuses_count":325,"url":"http://shenyuetian1992.blog.ifeng.com/","cover_image_phone":"http://ww1.sinaimg.cn/crop.0.0.640.640.640/549d0121tw1egm1kjly3jj20hs0hsq4f.jpg","user_type":2,"is_muteuser":false,"special_follow":false},"tabList":[{"name":"home","tabName":"精选"},{"name":"feed","tabName":"微博"},{"name":"album","tabName":"相册"}]}}
请问这是为什么啊