import urllib2
from BeautifulSoup import BeautifulSoup
page = urllib2.urlopen('http://bbs.hupu.com/13608969.html')
contents = page.read()
soup = BeautifulSoup(contents)
img=soup.findAll('img')
print img
print len(img)
for myimg in img:
link=myimg.get('src')
print link
content2 = urllib2.urlopen(link).read()
with open(u'E:\img'+'/'+link[-11:],'wb') as code:
code.write(content2)
能下载两张图,然后出现下面的错误
求高手解决