英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论