Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have the below data which is stored in a string. It resembles xml. Is there a way that I can extract the contents of div class "page" and extract all the text under it?
- Below is the content which is stored in a string variable:
- import xml.etree.ElementTree as ET
- xml = ET.fromstring(str_content)
- for tree in xml:
- print(tree.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement