How to get a value of nested <b> HTML tag in Python using regular expressions?
<a href="/model.xml?hid=90971&modelid=4636873&show-uid=678650012772883921" class="b-offers__name"><b>LG</b> X110</a>
# => LG X110
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.
Your question was very hard to understand, but from the given output example it looks like you want to strip everything within
<and>from the input text. That can be done like so:Which gives you:
If that is not what you want, please clarify.
Please note that the regular expression approach for parsing XML is very brittle. For instance, the above example would break on the input
<a name="b>c">hey</a>. (>is a valid character in a attribute value: see XML specs)