blob: 73dd696e63a829bfe69c205eaf05d610954bae7e (
plain)
1
2
3
4
5
6
7
8
9
10
|
#!/usr/bin/python
import urllib2, re
url = urllib2.urlopen('http://www.kernel.org')
html = url.read()
url.close()
table = re.search("""<table class="kver">.*?<td>(?P<kertext>.*?)&.*?</td>.*?<td><b><a href=".*?">(?P<kerver>.*?)</a></b></td>""", html, re.S)
print table.group('kertext'), table.group('kerver')
|