问题 1
在我用 Python 的 requests 爬取酷我音乐MV信息时报错:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
代码如下:
url = 'https://www.kuwo.cn/api/www/search/searchMvBykeyWord'
headers = {
'cookie': '...',
'user-agent': '...',
}
params = {
'key': '夜曲',
'pn': '1',
'rn': '30',
'httpsStatus': '1'
}
respond = requests.get(url=url, headers=headers, params=params)
print(respond.text)
text = respond.json()
打印出来的HTML内容如下,出现友好错误界面:
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden<