Giter Site home page Giter Site logo

Up to date team projections about espn-api HOT 5 CLOSED

cwendt94 avatar cwendt94 commented on May 21, 2024
Up to date team projections

from espn-api.

Comments (5)

pmracek avatar pmracek commented on May 21, 2024 1

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.

cwendt94 avatar cwendt94 commented on May 21, 2024

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.

voicelessreason avatar voicelessreason commented on May 21, 2024

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.

cwendt94 avatar cwendt94 commented on May 21, 2024

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.

loupalladino avatar loupalladino commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.