我使用以下链接来获取 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"/>
Instagram 更改了他们的 CORS 政策,因此无法直接在 html 中显示图像。唯一的方法是使用服务器端代理来绕过 CORS 策略。