Comments (5)
I have the same problem. Last year, I could scrape the projections out of the HTML with requests and beautifulsoup. Since the site redesign, the HTML returned to requests isn't the final code displayed to a user in an interactive browser session.
from espn-api.
Yeah so the best way I have been able to parse ESPN’s payload is by using chromes dev tools on ESPN fantasy website. I watch the network traffic and view the endpoints and data returned for each page and data.
For the problem you are trying to solve I have looked at it a little. It seems matchup and the fantasy cast on the website do not call any ESPN API endpoints. I think they might use web sockets for the live updates. I saw this also when leagues were live drafting the app and website didn’t call any endpoints. So I do not know if it is possible to grab this data.
from espn-api.
Oh man, that is really interesting, and that would definitely explain why that data is not available directly in the API response. I wonder if they are worried about making it accessible because it could reveal something about what they're doing algorithmically to arrive at those mid-match projections, or if its just an architectural choice insofar as they need to grab the data at a higher refresh rate than the rest of it.
At any rate, thanks so much for your response. I really appreciate all the work that you've done to get this tool off the ground 👍
from espn-api.
Yeah possibly. I know you can use chrome developer tools and specifically look at web sockets traffic but I haven’t had much time to look at it yet. Maybe there is a way!
No problem! I really enjoy being able to apply programming to fantasy football which I am really passionate about!
from espn-api.
The nesting they use now is nothing short of completely non-sensical. The div class values used to actually be intuitive but now they are a lot of the same class names repeated over and over, which makes things so much more difficult to scrape with bs4.
I know that projected totals are in a few places. Have we looked at the main scoreboard page for all of the league, i.e.:
https://fantasy.espn.com/football/league/scoreboard?leagueId=nnnnnn
That has a Projected Total that on the surface appears to be at a minimum scrape-able off the web page:
<div class="statusLabel">Proj Total:<span class="statusValue fw-bold">108</span></div>
This is outside both the main box score for the matchup as well as FantasyCast. I wonder if this yields anything different API-wise?
from espn-api.
Related Issues (20)
- Fix Team Data Change Working? HOT 1
- Add Owner info to Team
- Pulling League Data Errors in new season 23-24 HOT 1
- 'location' in data json doesn't exist anymore. Fix is provided HOT 2
- ESPN API Updated Key Names for Team Name HOT 1
- KeyError: 'location' in Fantasy BBall H2H Categories HOT 2
- Add back functionality to pull owner names HOT 4
- Getting "json.decoder.JSONDecodeError: Unterminated string" starting after NFL week 6 HOT 4
- Add accepted trade activity to fantasy basketball activity list HOT 3
- Player/Pick projected bid amount HOT 5
- slot_position only returning "PG" HOT 1
- Unable to get projected score of games of final completed week of season HOT 1
- Issue with Add full owner info to team commit HOT 2
- League.previousSeasons no longer an attribute? HOT 2
- Key Error when loading League HOT 2
- Lineups are only populating for first and current week matchups HOT 6
- Private League 2024 does not work HOT 2
- League object fails to instantiate when not all teams of league have managers HOT 2
- Roster Settings?
- ESPN returned an HTTP 403 HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espn-api.