from selectolax parser import HTMLParser html video width 320 height 2

1
2
3
4
5
6
from selectolax.parser import HTMLParser
html = '<video width="320" height="240" controls="">\n\t\t<source src="movie1.mp4"' \
' type="video/mp4">\n\t\t<source src="movie.ogg" type="video/ogg">' \
' Your browser does not support the video tag. </video>'
tree = HTMLParser(html)
print(tree.css_first('source').attributes)