网页抓取 NBA 统计数据 nba_api 端点
我正在尝试从 NBA 统计数据中抓取数据,特别是 团队的得分。我正在寻找此页面的 nba_api 端点,以便我可以抓取数据。
如何找到终点?
I am trying to scrape the data from NBA stats, specifically the team's boxscore. I am looking for the nba_api endpoint for this page so that i can scrape the data.
How can I find the endpoint?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过打开开发工具 (sfht-ctrl-i) 并在网络 -> 下查看来找到端点。 XHR(您可能需要刷新页面)。观察面板是否开始弹出请求,并找到包含您的数据的请求。转到标头查找发出请求所需的信息:
输出:
You find the endpoint by opening Dev Tools (sfht-ctrl-i) and look under Network -> XHR (you may need to refresh the page). Watch the panel for the requests to start popping up, and find the one that has your data. Go to Headers to find the info needed to make the request:
Output:
我不是一个超级体育迷,但这似乎是这样的: 免费NBA Boxscore API
您可以尝试将 CSS、JS 和 HTML 段与站点隔离。
它位于 div 的源代码中。
I'm not a huge sports fan, but this seems like it: A free NBA Boxscore API
You could attempt to isolate the CSS, JS and HTML segments from the site.
It is in the source of a div.