How to parse a block in Python?

Why Beautiful Soup parses incorrectly this unit?
Here's a simplified code, it bug is also reproduced:
soupIndex = BeautifulSoup("'<div class="vk-comment">
 <div class="Twitter-avatar">
 <img src="img.png">
</div>
 <div class="vk-comment-name">
 The name of the author
</div>
 <div class="vk-comment-text">
<p>
 The text of the comment
</p>
</div>
 <div class="vk-comment-date">
 17 minutes ago
</div>
</div>"')
template = soupIndex.select_one('.vk-comment')
print(template)


This variation in the output there are two extra div, but... If the length of the review to increase several times, then begins to copy the block vk-comment-date. I understand the longer a character representation of the block, the greater the number of symbols is duplicated at the end.

UPD: as the parser is the default html5lib, OS - Windows 7. Tried html parser, there is generally some nonsense going on, the img tag, for example, adds a closing tag.
July 2nd 19 at 17:25
3 answers
July 2nd 19 at 17:27
Solution
The problem was in the wrong display in the console, the data recorded in the file, there is normally displayed.
July 2nd 19 at 17:29
you need data from all of the div ?

for i in soupIndex.find_all('div'):
 print(i['class'])
no, I need to modify this block. On the basis of this unit is to generate a list. In any case can not understand what is wrong with this unit that the parser doesn't work right - Destinee.Hodkiewicz commented on July 2nd 19 at 17:32
: a list of what we need to generirati ? out of all the tags etc and all that is in them ? - Benny50 commented on July 2nd 19 at 17:35
Yes, that is the output should be a list of elements with the same structure as in the example, only with its text inside the tags. - Destinee.Hodkiewicz commented on July 2nd 19 at 17:38
July 2nd 19 at 17:31
preoperative

you must be from API a get, verify the data that come

PS. I recommend lxml

Find more questions by tags Beautiful SoupParsingPython