diff --git a/oxweb/allmovie.py b/oxweb/allmovie.py index a124f1f..978125d 100644 --- a/oxweb/allmovie.py +++ b/oxweb/allmovie.py @@ -15,9 +15,9 @@ def getMovieData(allmovieId): data['rating'] = findRe(html, '" alt="(\d+?) Stars"') data['country'] = findRe(html, '(.*?)(.*?)')).split(', ') - data['genre'] = map(lambda x: stripTags(x), findRe(html, 'Genre / Type(.*?)').split('
  • ')) - data['keywords'] = map(lambda x: stripTags(x), findRe(html, 'Keywords(.*?)').split('
  • ')) - data['themes'] = map(lambda x: stripTags(x), findRe(html, 'Themes(.*?)').split('
  • ')) + data['genre'] = parseList(html, 'Genre / Type') + data['keywords'] = parseList(html, 'Keywords') + data['themes'] = parseList(html, 'Themes') html = getUrlUnicode("http://www.allmovie.com/cg/avg.dll?p=avg&sql=1:%s~T1" % allmovieId) data['review'] = stripTags(findRe(html, 'Review.*?

    (.*?)')) return data @@ -28,6 +28,9 @@ def getMoviePoster(allmovieId): return data['poster'] return '' +def parseList(html, title): + return map(lambda x: stripTags(x), findRe(html, '%s(.*?)' % title).split('

  • ')) + if __name__ == '__main__': print getMovieData('177524')