首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我可以通过自定义搜索api检索Sitelinks吗?

我可以通过自定义搜索api检索Sitelinks吗?
EN

Stack Overflow用户
提问于 2016-01-19 13:27:30
回答 1查看 69关注 0票数 0

我想刮一下谷歌搜索结果中显示的站点链接(比如关于我们主页等)。我有什么办法能找回它们吗?在这里输入图像描述

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-03-02 18:33:11

我最近实现了Google,据我了解,获得网站链接的唯一方法是通过JSON回调,其中每个结果都包含formattedUrl或htmlFormattedUrl。该查询将是该网站的问题,并希望第一个结果将给你相关的网站链接。

然而,如果我正确理解你的问题,你想要取消一个给定网站的子链接,这是一个网络爬虫会做的事情。如果你是网站的所有者,你可以使用很多工具创建一个站点地图,但是如果你的意图可以被归类为“其他”,那么我相信你是在对错误的树吠叫。请参阅这个问题,它将指向您创建一个简单的WebCrawler。

//示例customsearch#result项,其中查询为Deovandski

代码语言:javascript
复制
 "items": [
  {
   "kind": "customsearch#result",
   "title": "Student Experience - College of Science and Mathematics (NDSU)",
   "htmlTitle": "Student Experience - College of Science and Mathematics (NDSU)",
   "link": "https://www.ndsu.edu/scimath/currentstudents/student_experience/",
   "displayLink": "www.ndsu.edu",
   "snippet": "Sep 16, 2015 ... Association for Computing Machinery Student Chapter Chair: Jordan Goetze \nAdvisor: Brian Slator. Upsilon Pi Epsilon President: Deovandski ...",
   "htmlSnippet": "Sep 16, 2015 \u003cb\u003e...\u003c/b\u003e Association for Computing Machinery Student Chapter Chair: Jordan Goetze \u003cbr\u003e\nAdvisor: Brian Slator. Upsilon Pi Epsilon President: \u003cb\u003eDeovandski\u003c/b\u003e ...",
   "cacheId": "pyzF9XJwrXsJ",
   "formattedUrl": "https://www.ndsu.edu/scimath/currentstudents/student_experience/",
   "htmlFormattedUrl": "https://www.ndsu.edu/scimath/currentstudents/student_experience/",
   "pagemap": {
    "cse_image": [
     {
      "src": "https://www.ndsu.edu/fileadmin/_processed_/csm_080117_anatomy_03med_9dbc3c8cce.jpg"
     }
    ],
    "cse_thumbnail": [
     {
      "width": "184",
      "height": "275",
      "src": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTTL-GZRfSv30cyESsCnd_65BFoLMDdo8fqNS58mHfRbGiOTjSq-e-o28FE"
     }
    ]
   }
  },
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34878059

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档