lxml.html extract a string by searching for a keyword
问题 I have a portion of html like below <li><label>The Keyword:</label><span><a href="../../..">The text</a></span></li> I want to get the string "The keyword: The text". I know that I can get xpath of above html using Chrome inspect or FF firebug, then select(xpath).extract(), then strip html tags to get the string. However, the approach is not generic enough since the xpath is not consistent across different pages. Hence, I'm thinking of below approach: Firstly, search for "The Keyword:" using