import requests, json
url = 'http://ictclas.nlpir.org/nlpir/index6/getWord2Vec.do'
headers={'origin':'http://ictclas.nlpir.org',
'referer':'http://ictclas.nlpir.org/nlpir/',
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36'
}
data = {'content': '上海'}
res = requests.post(url, headers=headers, data=data)
res = res.json() #转换为json
print(res)
#re = json.loads(res.text) #转换为json
#re = json.dumps(re) #转换为字符
try:
print(re['vjson'])
except:
print('err')