问题描述
几天前,我在 Power BI 中创建了一个 Web 查询,允许我从 NBA 球员统计数据 不使用任何标题.截至今天,我注意到该查询不再有效;我收到以下错误消息:
A couple of days ago in Power BI, I was able to create a web query that allowed me to extract the JSON data from NBA Player Stats without using any headers. As of today, I have noticed that the query no longer works; I am getting the following error message:
在相关说明中,我曾经能够从 NBA Team Stats 使用 https://stats.nba.com/
作为 Referer
标题,但现在它给了我同样的错误消息如上图.为了尝试解决这些错误,我尝试输入以下标题:
On a related note, I used to be able to pull the JSON data from NBA Team Stats using https://stats.nba.com/
as a Referer
header, but now it's giving me the same error message as shown above. To try and get around these errors, I have tried entering the following headers:
当我使用上述标题提交查询时,它会返回以下错误消息:
When I do submit the query with the above headers, it comes back with the following error message:
对于如何正确运行查询,我已经没有想法了.我对网络抓取和 HTML 真的很陌生——我一直在努力自学.非常感谢任何帮助.
I have run out of ideas as to how I'm able to properly run the query. I'm really new to web-scraping and HTML -- I've been trying to teach myself. Any help is greatly appreciated.
推荐答案
GET 请求的所有标头:
All headers for GET request:
网址:
必填标题:
不确定是否需要:
可能的问题:
您检测为机器人并被阻止
You detected as a bot and blocked
Header X-NewRelic-ID
是一个令牌(可能有超时).可能它是使用不同的参数分配的,例如 IP
、User-Agent 等等.
您可以通过对 https://stats.nba.com/
的 GET 请求在 HTML 响应中获取新的 X-NewRelic-ID
.这是带有 xpid
标记的 HTML 的一部分:<script type="text/javascript">(window.NREUM||(NREUM={})).loader_config={xpid:"VQECWF5UChAHUlNTBwgBVw==",licenseKey:"09f0cb5c68",applicationID:"76210961"};
Header X-NewRelic-ID
is a token (maybe with timeout). Probably it's assign using different params like IP
, User-Agent and among others.
You can get fresh X-NewRelic-ID
in HTML response with GET request to https://stats.nba.com/
.
Here is a part from HTML with xpid
token:
<script type="text/javascript">(window.NREUM||(NREUM={})).loader_config={xpid:"VQECWF5UChAHUlNTBwgBVw==",licenseKey:"09f0cb5c68",applicationID:"76210961"};
这篇关于我缺少哪些标题来抓取 NBA 统计数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!