Is there an easy way to use the Python library html5lib to convert something like this:
<p>Hello World. Greetings from <strong>Mars.</strong></p>
to
Hello World. Greetings from Mars.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With
lxmlas the parser backend:To be honest, this is actually cheating, as it is equivalent to the following (only the relevant parts are changed):
If you really want the
html5libparsing engine: