url = 'http://www.imdb.com/title/tt%s/' % (id,)
soup = BeautifulSoup(urllib.request.urlopen(url).read())
print('before FOR')
for tag in soup.findAll(itemprop='image'):
    print('inside FOR')
print(tag['src'])
Extracting image src based on attribute with BeautifulSoup