Fixed crash when img src tag is missing

This commit is contained in:
Alexander Zolotarev 2013-08-13 22:13:40 +03:00
parent 4f4f2aba6f
commit f957c53c41

View file

@ -71,7 +71,7 @@ def cleanUp(soup):
def changeImgSrcAttr(soup):
# Use s attribute instead of src for images
for imgElement in soup.findAll("img"):
for imgElement in soup.select('img[src]'):
imgElement["s"] = imgElement["src"]
del imgElement["src"]