I have a QLabel that contains rich text.
I want to extract only the actual (visible) "text" from QLabel and not one of the code to format.
I need a function similar to the '.toPlainText' method of another Qt Widgets .
I canβt just call .text() , and the string will process the html tags as suggested in this thread Get plain text from a QString with HTML tags , because the returned QString contains all the crap <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> .
How to extract plain text?
(I am open to any method, even if indirect, for example, pre-existing functions that convert html to plain text)
Thanks!
Specifications:
python 2.7.2
PyQt4
Windows 7
source share