Get all text inside a tag in lxml

I’d like to write a code snippet that would grab all of the text inside the <content> tag, in lxml, in all three instances below, including the code tags. I’ve tried tostring(getchildren()) but that would miss the text in between the tags. I didn’t have very much luck searching the API for a relevant function. Could you help me out?

How can I translate dates and times from natural language to datetime?

I’m looking for a way to translate ‘tomorrow at 6am’ or ‘next monday at noon’ to the appropriate datetime objects. I thought of engineering a complex set of rules, but is there another way? Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve … Read more