Good that you found an solution,here an other way.
Some advice,should always use Requests.
You see the yellow banner
So this code is for python 3.6 and work on Windows, Python 3.6 and pip installation under Windows
Some advice,should always use Requests.
You see the yellow banner
So this code is for python 3.6 and work on Windows, Python 3.6 and pip installation under Windows
import requests from bs4 import BeautifulSoup url = 'http://www.imdb.com/title/tt2527336/?ref_=rlm' # Test other url #url = 'http://www.imdb.com/title/tt5294550/?ref_=inth_ov_i' #url = 'http://www.imdb.com/title/tt5726086/?ref_=inth_ov_tt' url_get = requests.get(url) soup = BeautifulSoup(url_get.content, 'lxml') image = soup.find('div', class_="poster") image_name = image.find('img').get('alt').replace(':', '') image_url = image.find('img').get('src') # Download response = requests.get(image_url) with open(f'{image_name}.jpg', 'wb') as f: f.write(response.content)