'Get popular show information from IMDB'

def fetch_popular_shows(self):

    popular_shows = []
    data = helpers.getURL(self.url, session=self.session, params=self.params, headers={u'Referer': u'http://akas.imdb.com/'}, returns=u'text')
    if (not data):
        return None
    soup = BeautifulSoup(data, u'html5lib')
    results = soup.find(u'table', {u'class': u'results'})
    rows = results(u'tr')
    for row in rows:
        show = {}
        image_td = row.find(u'td', {u'class': u'image'})
        if image_td:
            image = image_td.find(u'img')
            show[u'image_url_large'] = self.change_size(image[u'src'], 3)
            show[u'image_path'] = ek(posixpath.join, u'images', u'imdb_popular', ek(os.path.basename, show[u'image_url_large']))
            self.cache_image(show[u'image_url_large'])
        td = row.find(u'td', {u'class': u'title'})
        if td:
            show[u'name'] = td.find(u'a').contents[0]
            show[u'imdb_url'] = (u'http://akas.imdb.com' + td.find(u'a')[u'href'])
            show[u'imdb_tt'] = show[u'imdb_url'][(-10):][0:9]
            show[u'year'] = td.find(u'span', {u'class': u'year_type'}).contents[0].split(u'    ')[0][1:]
            rating_all = td.find(u'div', {u'class': u'user_rating'})
            if rating_all:
                rating_string = rating_all.find(u'div', {u'class': u'rating    rating-list'})
                if rating_string:
                    rating_string = rating_string[u'title']
                    match = re.search(u'.*    (.*)\\/10.*\\((.*)\\).*', rating_string)
                    if match:
                        matches = match.groups()
                        show[u'rating'] = matches[0]
                        show[u'votes'] = matches[1]
                    else:
                        show[u'rating'] = None
                        show[u'votes'] = None
            else:
                show[u'rating'] = None
                show[u'votes'] = None
            outline = td.find(u'span', {u'class': u'outline'})
            if outline:
                show[u'outline'] = outline.contents[0]
            else:
                show[u'outline'] = u''
            popular_shows.append(show)
    return popular_shows
