Tips for Identifying and Saving JSON? /u/BeBetterMySon Python Education

Background: I’m trying to scrape some of ESPN’s NFL statistics pages, specifically their statistics on receiving yards (https://www.espn.com/nfl/stats/player/_/stat/receiving). I asked for help here earlier (thank you!) and learned that to extract the JSON from the page I’d need to use:

info=json.loads(stats.text.split("window['__espnfitt__']=")[-1][:-1]) 

The only issue is I don’t quite understand how to find this or what to look for. Do you guys have any tips for finding JSON?

submitted by /u/BeBetterMySon
[link] [comments]

​r/learnpython Background: I’m trying to scrape some of ESPN’s NFL statistics pages, specifically their statistics on receiving yards (https://www.espn.com/nfl/stats/player/_/stat/receiving). I asked for help here earlier (thank you!) and learned that to extract the JSON from the page I’d need to use: info=json.loads(stats.text.split(“window[‘__espnfitt__’]=”)[-1][:-1]) The only issue is I don’t quite understand how to find this or what to look for. Do you guys have any tips for finding JSON? submitted by /u/BeBetterMySon [link] [comments] 

Background: I’m trying to scrape some of ESPN’s NFL statistics pages, specifically their statistics on receiving yards (https://www.espn.com/nfl/stats/player/_/stat/receiving). I asked for help here earlier (thank you!) and learned that to extract the JSON from the page I’d need to use:

info=json.loads(stats.text.split("window['__espnfitt__']=")[-1][:-1]) 

The only issue is I don’t quite understand how to find this or what to look for. Do you guys have any tips for finding JSON?

submitted by /u/BeBetterMySon
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *