2

centos系统各种包下载

 3 years ago
source link: http://abcdxyzk.github.io/blog/2014/06/09/system-centos-packages/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

centos系统各种包下载

2014-06-09 15:15:00

0 centos 系統原包

爬取el7所有版本

import re
import urllib

def getHtml(url):
	page = urllib.urlopen(url)
	html = page.read()
	return html

def getHref(html, reg):
	reg = re.compile(reg)
	reslist = re.findall(reg, html)
	return reslist

URL = "https://buildlogs.centos.org/"
html = getHtml(URL)
c7Href = getHref(html, r'href="(c7.+)/"')
for ver in c7Href:
	if '.a32' in ver or '.a64' in ver or '.p32' in ver or '.i386' in ver:
		continue
	url1 = URL + ver + "/kernel/"
	print url1
	html = getHtml(url1)
	dateHref = getHref(html, r'href="(20............)/"')
	for date in dateHref:
		url2 = url1 + date + "/"
		html = getHtml(url2)
		kernelHref = getHref(html, r'href="(.+el7.x86_64)/"')
		for kver in kernelHref:
			print url2 + kver

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK