1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-18 05:58:55 +00:00

[core] utils: fix get_element_by_*

This commit is contained in:
Allen
2024-12-04 23:10:45 +01:00
parent 354cb4026c
commit d9195b5133
2 changed files with 21 additions and 1 deletions

View File

@@ -442,7 +442,7 @@ def get_element_text_and_html_by_tag(tag, html):
content_start += whole_start + 1
with HTMLBreakOnClosingTagParser() as parser:
parser.feed(html[whole_start:content_start])
if not parser.tagstack or parser.tagstack[0] != tag:
if not parser.tagstack or parser.tagstack[0] != tag.lower():
raise compat_HTMLParseError(f'parser did not match opening {tag} tag')
offset = content_start
while offset < len(html):