简体   繁体   English

如何找到网站使用的 API?

[英]How can I find the API that a website uses?

I have a small personal project which consists of grouping several data from several websites in order to have them all in the same place.我有一个小型个人项目,其中包括对来自多个网站的多个数据进行分组,以便将它们全部放在同一个地方。 Because of this, I use BeautifulSoup with Flask to be able to scrape the data.因此,我使用 BeautifulSoup 和 Flask 来抓取数据。

However, I wish I could do the same for the following site: https://cartographie.ville.terrebonne.qc.ca/patin-exterieur/ but it's an interactive map and I can't take the information from each popup when clicking on a skate.但是,我希望我可以对以下站点执行相同的操作: https://cartographie.ville.terrebonne.qc.ca/patin-exterieur/但它是一个交互式 map,单击时我无法从每个弹出窗口中获取信息在溜冰鞋上。 After reading about it, I've come to the conclusion that the website in question must be using an API to display their data so I could be able to parse the datas, but navigating through Google chrome's developer mode I can't seem to find the correct api where all the data is stored.阅读后,我得出的结论是,有问题的网站必须使用 API 来显示他们的数据,这样我就可以解析数据,但是通过谷歌浏览器的开发者模式导航我似乎找不到存储所有数据的正确 api。 Does someone have any ideas?有人有什么想法吗?

In Chrome DevTools "Fetch/XHR" tab, you can see new API requests as you move the map around.在 Chrome DevTools 的“Fetch/XHR”选项卡中,您可以在移动 map 时看到新的 API 请求。 Looks like the API response is application/x-protobuf , which is most likely a binary data response that you would need to parse.看起来 API 响应是application/x-protobuf ,这很可能是您需要解析的二进制数据响应。

在此处输入图像描述

They are usinghttps://developers.arcgis.com/javascript/latest/maps-and-views/他们正在使用https://developers.arcgis.com/javascript/latest/maps-and-views/

Which is part of Esri.这是 Esri 的一部分。 A big machine learning data science service.大型机器学习数据科学服务。

You wont get far with this to be honest as you wont get any authorization.老实说,您不会走得太远,因为您不会获得任何授权。

You can go through the website and press F12, then go to the Network part and Headers look for "Request Headers"您可以通过网站 go 并按 F12,然后 go 到Network 部分Headers查找“请求标头” 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM