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" />
To co staram się wydobyć z i otrzymuję:Python 2.7 Piękne Soup img src Extract
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
''”
Wciąż otrzymuję błąd: Traceback (najnowsza rozmowę ostatnia): pliku "C: \ Users \ BuyzDirect \ Pulpit \ OverStock_Listing_Format_Tool.py", linia 50, w findPatImgSrc = patImgSrc .findall (imgsrc) TypeError: oczekiwany ciąg lub bufor –
phales15