В основном в этой строке:
item = items.find("image:title").text
items.find("image:title")
return None
(вероятно, потому что find
не находит того, что вы ожидаете в items
).Итак, поскольку None
не имеет атрибута text
, тогда (None).text
вызывает ошибку AttributeError: 'NoneType' object has no attribute 'text'
Если вы хотите исправить ошибку, вы можете сделать:
item = items.find("image:title")
if item:
title = item.text # you can use other variable name if you want to.
else:
print("there is no image:title in items")