Get all tagged text under li tags
Question: I have list like:

    
    
    <ul>
    <li><strong>Text 1</strong></li>
    <li>Text 2</li>
    <li>Text 3</li>
    <li><strong>Text 4</strong></li>
    </ul>
    

How i can get only values under strong tag using selenium webdriver in python?


Answer: Assuming the data is always in the presented form, a simple regex will do:

    
    
    import re
    re.findall(r'<li><strong>([^<]*)</strong></li>', my_text)
    

