Have you tried domonic?
A dom made for python.
pip install domonic
python3
from domonic.html import *
mydom = html(body(h1('Hello, World!'), a("somelink", _href="somepage.html")))
print(f"{mydom}")
<!DOCTYPE html>
<html>
<body>
<h1>Hello, World!</h1>
<a href="somepage.html">somelink</a>
</body>
</html>
Top comments (0)