如何使用html/javascript在前端显示instagram个人资料图片?

问题描述 投票:0回答:1

我使用以下链接来获取 Instagram 个人资料图片:

https://www.instagram.com/USERNAME/?__a=1&__d=1

这会获取“profile_pic_url”属性中的 dp。

当我尝试像这样在 html 中显示图像时:

<img width="70" src= <profile_pic_url> alt="Profile" className="profile-pic-preview"/>

我收到以下错误:

html image frontend instagram-api
1个回答
0
投票

Instagram 更改了他们的 CORS 政策,因此无法直接在 html 中显示图像。唯一的方法是使用服务器端代理来绕过 CORS 策略。

© www.soinside.com 2019 - 2024. All rights reserved.