for imgsrc in Soup.findAll('img', {'class': 'sizedProdImage'}):
if imgsrc:
imgsrc = imgsrc
else:
imgsrc = "ERROR"
patImgSrc = re.compile('src="(.*)".*/>')
findPatImgSrc = re.findall(patImgSrc, imgsrc)
print findPatImgSrc
'''
<img height="72" name="proimg" id="image" class="sizedProdImage" src="http://imagelocation" />
Questo è quello che sto cercando di estrarre da e sto ottenendo:Python 2.7 Beautiful Soup img src Estratto
findimgsrcPat = re.findall(imgsrcPat, imgsrc)
File "C:\Python27\lib\re.py", line 177, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or buffer
'''
ancora ottenere l'errore: Traceback (chiamata più recente scorso): file "C: \ Users \ BuyzDirect \ Desktop \ OverStock_Listing_Format_Tool.py", linea 50, in findPatImgSrc = patImgSrc .findall (imgsrc) TypeError: stringa o buffer previsto –
phales15