【发布时间】:2021-11-07 23:54:15
【问题描述】:
我正在尝试从here 访问“datePublished”。它在源代码中可见:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://www.minecraft.net/en-us/article/minecraft-java-edition-1-17-1"
},
"headline": "Article headline",
"image": [
"https://www.minecraft.net/content/dam/games/minecraft/screenshots/1-17-1-release-header.jpg"
],
"datePublished": "2021-07-06T13:42:49.957+0000",
"author": {
"@type": "Person",
"name": "Adrian Östergård"
},
"publisher": {
"@type": "Organization",
"name": "Minecraft",
"logo": {
"@type": "ImageObject",
"url": "https://www.minecraft.net/etc.clientlibs/minecraft/clientlibs/main/resources/img/header/logo.png"
}
}
}</script>
我尝试使用 url 来字符串解析器,然后提取 json,但该元素没有显示在日志中。 非常感谢
【问题讨论】:
-
欢迎来到 Stack Overflow。请通过tour 了解 Stack Overflow 的工作原理,并阅读How to Ask 以了解如何提高问题的质量。请显示您尝试过的尝试以及您从尝试中得到的问题/错误消息。
标签: java android html json json-ld