抓取Github今天流行的仓库

模板 yibu 9个月前 (12-26) 277次浏览 1个评论

抓取 Github 今天流行的仓库

1、数据字段

  • 用户名
  • 仓库名
  • 仓库地址
  • 仓库地址-href
  • 仓库描述
  • 语言类型
  • star 总数
  • fork 总数
  • 今日 star 数

 

2、结果示例截图

抓取Github今天流行的仓库

 

3、Sitemap

{"_id":"github-today-trending","startUrl":["https://github.com/trending"],"selectors":[{"id":"trendingRepoList","type":"SelectorElement","parentSelectors":["_root"],"selector":"li.col-12","multiple":true,"delay":"2000"},{"id":"用户名","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"span.ghh-user-x","multiple":false,"regex":"","delay":0},{"id":"仓库名","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"span.ghh-repo-x","multiple":false,"regex":"","delay":0},{"id":"仓库地址","type":"SelectorLink","parentSelectors":["trendingRepoList"],"selector":"h3 a","multiple":false,"delay":0},{"id":"仓库描述","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"p.col-9","multiple":false,"regex":"","delay":0},{"id":"语言类型","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"span.d-inline-block span:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"star 总数","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"a.muted-link:nth-of-type(1)","multiple":false,"regex":"","delay":0},{"id":"fork 总数","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"a.muted-link:nth-of-type(2)","multiple":false,"regex":"","delay":0},{"id":"今日 star 数","type":"SelectorText","parentSelectors":["trendingRepoList"],"selector":"span.d-inline-block.float-sm-right","multiple":false,"regex":"([\\d[,]?)*[\\d]","delay":0}]}

喜欢 (2)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. yibu
    该sitemap的用到了 正则表达式提取文本
    yibu2018-12-26 09:21 回复