# -*- coding: utf-8 -*-
import urllib2

def GetUrlList(urlpage):
	slicer = 1
	List = []
	u = urllib2.urlopen(urlpage)
	page = u.read()
	while (slicer != -1):
		slicer = slicer + 1	
		slicer = page.find('<li><a href="',slicer)
		Url = page[slicer+13:page.find('"',slicer+15)]
		List.append(Url)
		
	return List[0:-1]


urlpage = 'http://cheesefondue.ru/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:%D0%9D%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D0%BA%D1%83%D1%85%D0%BD%D0%B8'

UrlList = GetUrlList(urlpage)

for x in UrlList:
	LongUrl = "http://cheesefondue.ru" + x
	u = urllib2.urlopen(LongUrl)
	page = u.read()
	artsl = page.find('<title>')
	title_name = page[artsl+26:page.find('—',artsl+1)-1]
	artsl = page.find('<div id="mw-pages">')
	if artsl == -1:
		artnum = '1'
	else:

		artsl = page.find('<p>',artsl)
		artnum = page[artsl+3:page.find('.',artsl+1)]
		if len(artnum) == 81:
			artnum = ' 1'
		else:
			artnum = artnum[artnum.find(' из')+5:artnum.find(' из')+7]

 

		#artnum = page[artsl+1:artsl+200]


	

	print '* [[:Категория:' + title_name + '|' + title_name + ']] - (статей:' + artnum + ')\n'



362d9b523f45126420df3a3344d6bbdaf134a4fc
# -*- coding: utf-8 -*-
import urllib2

def GetUrlList(urlpage):
	slicer = 1
	List = []
	u = urllib2.urlopen(urlpage)
	page = u.read()
	while (slicer != -1):
		slicer = slicer + 1	
		slicer = page.find('<li><a href="',slicer)
		Url = page[slicer+13:page.find('"',slicer+15)]
		List.append(Url)
		
	return List[0:-1]


urlpage = 'http://cheesefondue.ru/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:%D0%9D%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D0%BA%D1%83%D1%85%D0%BD%D0%B8'

UrlList = GetUrlList(urlpage)

for x in UrlList:
	LongUrl = "http://cheesefondue.ru" + x
	u = urllib2.urlopen(LongUrl)
	page = u.read()
	artsl = page.find('<title>')
	title_name = page[artsl+26:page.find('—',artsl+1)-1]
	artsl = page.find('<div id="mw-pages">')
	if artsl == -1:
		artnum = '1'
	else:

		artsl = page.find('<p>',artsl)
		artnum = page[artsl+3:page.find('.',artsl+1)]
		if len(artnum) == 81:
			artnum = ' 1'
		else:
			artnum = artnum[artnum.find(' из')+5:artnum.find(' из')+7]

 

		#artnum = page[artsl+1:artsl+200]


	

	print '* [[:Категория:' + title_name + '|' + title_name + ']] - (статей:' + artnum + ')\n'


