mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-11 07:01:54 +02:00
[utils] Improve get_elements_text_and_html_by_attribute
regex (#2280)
Authored by: zmousm, pukkandan
This commit is contained in:
parent
a70b71e85a
commit
0254f16274
2 changed files with 15 additions and 16 deletions
|
@ -1659,10 +1659,10 @@ Line 1
|
|||
html = self.GET_ELEMENTS_BY_CLASS_TEST_STRING
|
||||
|
||||
self.assertEqual(
|
||||
get_elements_text_and_html_by_attribute('class', 'foo bar', html),
|
||||
list(get_elements_text_and_html_by_attribute('class', 'foo bar', html)),
|
||||
list(zip(['nice', 'also nice'], self.GET_ELEMENTS_BY_CLASS_RES)))
|
||||
self.assertEqual(get_elements_text_and_html_by_attribute('class', 'foo', html), [])
|
||||
self.assertEqual(get_elements_text_and_html_by_attribute('class', 'no-such-foo', html), [])
|
||||
self.assertEqual(list(get_elements_text_and_html_by_attribute('class', 'foo', html)), [])
|
||||
self.assertEqual(list(get_elements_text_and_html_by_attribute('class', 'no-such-foo', html)), [])
|
||||
|
||||
GET_ELEMENT_BY_TAG_TEST_STRING = '''
|
||||
random text lorem ipsum</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue