【发布时间】:2021-02-13 14:40:49
【问题描述】:
我想选择带有og:title 属性的元标记并从中获取内容文本值,即Silver Surfer,我不知道如何在 Cheerio 中解决这个问题
<meta property="og:type" content="SILVER" />
<meta property="og:image" content="http://img.silversurfer.com/surfer.png"/>
<meta property="og:title" content="Silver Surfer" />
<meta property="og:url" content="https://www.silversurfer.com" />
这是我迄今为止的最新尝试
var title = $('meta[property=og:title]').content
【问题讨论】:
-
如果您无法弄清楚,您一定尝试了几件事。给他们看。
-
刚刚编辑了我原来的帖子!
标签: html jquery jquery-selectors cheerio