#!/usr/bin/env python

import sys

from lib.Category import Category
from lib.FileHandle import FileHandle

sys.setrecursionlimit(10000);

category_id = sys.argv[1];	

catObj = Category();

html =catObj.getCategoryHtml(category_id);
if html == 'Error':
	print("No category with ID:"+category_id);
else:
	FileHandle.saveFile(category_id+'.html', html);