How can I determine the tag at the found element? I tried this:

print(item.get("tag")) print(item.img) print(type(item)) 

The first two returned None, the third threw out a mistake.

 Traceback (most recent call last): File "D:/Project/Parsers_site/spr_ru.py", line 179, in <module> spr_ru("https://www.spr.ru/otzyvy/sm-klinika-1111439.html") File "D:/Project/Parsers_site/spr_ru.py", line 48, in spr_ru print(type(content)) TypeError: 'str' object is not callable 
  • one
    Try item.name - Andrey
  • one
    @Andrey thanks, I didn’t guess something before - danilshik pm
  • @Andrey can mark as an answer - danilshik 4:44 pm
  • ok, I'll do it now. - Andrey

1 answer 1

Tag name can be obtained using .name

 item.name