我正在尝试从以下 URL 获取图像:
image_url = http://www.eatwell101.com/wp-content/uploads/2012/11/Potato-Pancakes-recipe.jpg?b14316
当我在浏览器中导航到它时,它看起来确实像一张图像。但是当我尝试时出现错误:
import urllib, cStringIO, PIL
from PIL import Image
img_file = cStringIO.StringIO(urllib.urlopen(image_url).read())
image = Image.open(img_file)
IOError:无法识别图像文件
我以这种方式复制了数百张图像,所以我不确定这里有什么特别之处。我可以得到这个图像吗?