我想凑这个链接的网站:获取JSON数据与Python
https://www.whoscored.com/Players/11119/Show/Lionel-Messi
我想从汇总的数据,防守,进攻的标签和我试图 这:
import requests
# This is the json data link i wish to get from the defensive tab (from developer tools)
url = "https://www.whoscored.com/StatisticsFeed/1/GetPlayerStatistics?category=summary&subcategory=defensive&statsAccumulationType=0&isCurrent=true&playerId=11119&teamIds=&matchId=&stageId=&tournamentOptions=&sortBy=Rating&sortAscending=&age=&ageComparisonType=&appearances=&appearancesComparisonType=&field=Overall&nationality=&positionOptions=&timeOfTheGameEnd=&timeOfTheGameStart=&isMinApp=false&page=&includeZeroValues=true&numberOfPlayersToPick="
response = requests.get(url)
print(response.json())
我无法管理打印JSON数据并从标签中刮取需要的数据,我是否做错了什么? 感谢您的帮助。
URL至少与此问题中所写的一样无效。 – n1c9
响应是HTML,而不是JSON,所以这不起作用。 – Kamran