You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
url = 'https://a.jd.com//ajax/queryServerData.html'
ret = requests.get(url).text
filename = 'timm.txt'
with open(filename, "w") as file:
file.write(ret)
with open(filename, "r") as file:
for line in file:
if "serverTime" in line:
print(line)
date_str = line[43:62]
date_format = "%Y/%m/%d %H:%M:%S"
datetime_obj = datetime.datetime.strptime(date_str, date_format)
timestamp = int(datetime_obj.timestamp() * 1000)
print(timestamp)
\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)。
目测是京东接口变了?json解析失败了,有朋友解决了吗
The text was updated successfully, but these errors were encountered: