LinkedIn 在共享网站时不获取元数据

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

我在 LinkedIn 上共享正在开发的网站时遇到问题:LinkedIn 不会从该页面获取任何数据。该网站的元数据遵循其文档中的建议。我尝试了所有这些建议

此外,我调查了以下内容:

  1. 通过 HTTP 而不是 HTTPS 提供内容,但许多其他网站通过 HTTPS 提供服务,例如 https://stripe.com/nohttps://www.facebook.com/,工作得很好。
  2. 作为公司页面发布。除了允许手动数据输入(作为临时解决方案很方便)之外,这没有任何区别。
  3. 以其他用户身份发帖。没有任何区别。
  4. 在网站上发布新内容,以确保 LinkedIn 没有缓存元数据。这也没有什么区别。
  5. 在我添加 Open Graph 元标记之前这也是一个问题。

这可能是 LinkedIn 导致的问题,但是 – 考虑到这也适用于其他网站 – 我愿意接受我是做错事的人的可能性。

html share linkedin-api facebook-opengraph meta-tags
6个回答
9
投票

我认为您在大约一周内不会看到 LinkedIn 从您网站获取的数据有任何变化:

当 LinkedIn 的爬虫程序第一次访问网页时,当要求通过 URL 共享内容时,它找到的数据(开放图谱值或我们自己的分析)将被缓存大约 7 天。

这意味着,如果您随后更改文章的描述、上传新图像、修复标题中的拼写错误等,您将不会在任何后续尝试共享页面的过程中看到所表示的更改,直到缓存过期并且爬网程序被迫重新访问页面以检索新内容。

https://developer.linkedin.com/docs/share-on-linkedin(滚动到底部)


1
投票

与所有编程一样,让我们首先看看官方LinkedIn共享文档! LinkedIn 共享 API 将尊重 HTML 中的以下

og:
标签...

  • <meta property='og:title' content='Title of the article"/>
  • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
  • <meta property='og:description' content='Description that will show in the preview"/>
  • <meta property='og:url' content='//www.example.com/URL of the article" />

想确保您正确使用它吗?这很简单 - 查看 官方 LinkedIn 帖子检查器 来调试、检查和验证您的共享 URL。


1
投票

在我的例子中,LinkedIn 解析器似乎真的很差,如果你的 HTML 文件没有

<head>
标签(规范不需要),它会简单地忽略下面不起作用的所有内容

<!doctype html>
<meta charset=utf-8>                                                            
<meta property=og:title content='My Shared Article Title'>                      
<meta property=og:description content='Description of shared article'>          
<meta property=og:image content=http://i.imgur.com/12345.jpg>                
<meta name=description content='Nice description'>
<title>TEST 15</title>
<p>content here</p>

但只需添加开始

<head>
标签(仍然有效的 HTML),就可以了

<!doctype html>
<head>
<meta charset=utf-8>                                                            
<meta property=og:title content='My Shared Article Title'>                      
<meta property=og:description content='Description of shared article'>          
<meta property=og:image content=http://i.imgur.com/12345.jpg>                
<meta name=description content='Nice description'>
<title>TEST 15</title>
<p>content here</p>

0
投票

我遇到了完全相同的问题。清除您的缓存历史记录。然后将这个 'prefix="og: http://ogp.me/ns#'" 添加到每个元数据标签中,它将立即起作用:

    <meta prefix="og: http://ogp.me/ns#" property='og:title' content='Content Title'/>
    <meta prefix="og: http://ogp.me/ns#" property='og:image' content='https://images.url...'/>
    <meta prefix="og: http://ogp.me/ns#" property='og:description' content='Description'/>
    <meta prefix="og: http://ogp.me/ns#" property='og:url' content='https://site_url/'/>

0
投票

这将为您解决问题,只需在此处输入您的网站,它似乎会清除他们的缓存,在我的情况下,缓存大约有 3 年历史???

https://www.linkedin.com/post-inspector/inspect/


0
投票

对我来说,问题是

og:url
标签始终包含根域的值:

<meta property="og:url" content="https://example.com/">

这导致linkedin总是获取并显示这个根域的缓存内容(只有linkedin有这个问题,它在其他所有网站上都可以工作,比如facebook,whatsapp,instagram,ms team,一切 - 这就是我如此困惑的原因) .

当我开始覆盖每个子页面上的

og:url
时,问题就消失了。

// page 1:
<meta property="og:url" content="https://example.com/page-11">
// page 2:
<meta property="og:url" content="https://example.com/page-2">
// etc.
© www.soinside.com 2019 - 2024. All rights reserved.