标签:hub text ges ref blog .text pre lis 运行
# -*- coding:utf-8 -*- __author__ = "MuT6 Sch01aR" import requests from pyquery import PyQuery def GetGitHub(): url = "https://github.com/trending/python" r = requests.get(url) for i in PyQuery(r.content)(".repo-list>li"): repo_url = "https://github.com"+PyQuery(i).find(".mb-1 a").attr("href") name = PyQuery(i).find(".mb-1 a").text() star = PyQuery(i).find("a.mr-3").text() print("项目:"+name,"星星数:"+star,"项目地址:"+repo_url) GetGitHub()
运行结果
标签:hub text ges ref blog .text pre lis 运行
原文地址:http://www.cnblogs.com/sch01ar/p/7896964.html