import xbmc, xbmcgui, re, os, sys, cachedhttp, urllib, urllib2, IMDbLib from StringIO import StringIO from string import split, replace, find sock = urllib.urlopen('http://allmusic.com/cg/amg.dll?p=amg&sql=73:') page = sock.readlines() sock.close() #print page Genres = "" Genres2 = "" genres = re.compile(r'.*') genres_ = re.compile(r'.*?img src="/i/spacer.gif".*') i = 0 while i < len(page): if genres.match(page[i]): in_genres = re.compile(r""">Popular Genre <(.*?)
""") g1 = in_genres.findall(page[i]) g2 = re.compile(r"""onclick="z(\'(.*?)\')">