#!/usr/bin/python #encoding: utf8 import re, sys, urllib, time def fetch_page(num): sock = urllib.urlopen('http://www.habrahabr.ru/people/page%d/' % num) html = sock.read().decode('CP1251') sock.close() return html def grep_users(page): p = re.compile(u'.*.*(.*).*.*', re.DOTALL | re.UNICODE); m = p.match(page) if m: ucode = m.group(1) else: return [] u = re.compile('.*