import requests from bs4 import BeautifulSoup url = 'https://yuncode.net/list/python' wb_data = requests.get(url) soup = BeautifulSoup(wb_data.content) #获取最新python代码库 content = soup.select(".type_column .title_title a") for i in content: print(i.text) print(i['href'])