如何使用importxml从Instagram照片中提取静态/封面照片?

huangapple go评论59阅读模式
英文:

How do I use importxml to pull a still/cover photo from an instagram photo?

问题

我正在创建一份关于社交媒体表现的报告。我在一个单元格中有帖子的链接,并使用importxml来提取照片/视频,以便人们知道我在引用哪个帖子。以下是我使用的公式:

=IMAGE(IMPORTXML(D63,"//meta[@property='og:image']/@content"))

然而,在Instagram帖子上,图片被切成了一半,但在TikTok帖子上看起来很好。我无法弄清楚在经过检查Instagram元素并尝试不同的xpath后,应该使用什么xpath。希望这里有人能提供答案!

我得到的照片被切成了一半,几乎就像它没有完成加载一样。

英文:

I'm creating a report on social media performance. I have the link to the post in a cell and I'm using importxml to pull the photo/video so people know which post i'm referencing. Here's the formula I'm using:

=IMAGE(IMPORTXML(D63,"//meta[@property='og:image']/@content"))

However, the image is cut in half on the instagram posts - but looks great on the tiktok posts. I can't figure out what the xpath should be instead after experimenting with inspecting element on instagram & playing around with different xpaths. Hoping someone here might have an answer!

I get a a photo that's cut half way, almost as if it didn't finish loading.

答案1

得分: 1

以下是翻译好的内容:

<!-- language-all: js -->

*这是一种方法:*

=image(substitute(A2, "reel", "p")&"media/?size=l")

[![输入图像描述在这里][1]][1]

  [1]: https://i.stack.imgur.com/Rw6zm.jpg
英文:

<!-- language-all: js -->

Here's one approach:

=image(substitute(A2,&quot;reel&quot;,&quot;p&quot;)&amp;&quot;media/?size=l&quot;)

如何使用importxml从Instagram照片中提取静态/封面照片?

huangapple
  • 本文由 发表于 2023年7月13日 22:22:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76680460.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定