How to convert HTML object to str object

60 Views Asked by At

Generally, str objects display on the console. How can I convert my html object to an str object so that it can display on the console?

x = HTML('<p>hello</p>')
string = str(x)
display(string)
0

There are 0 best solutions below