Top "Elementtree" questions

ElementTree is a Python library for creating and parsing XML.

UnicodeEncodeError: 'ascii' codec can't encode characters

I have a dict that's feed with url response. Like: >>> d { 0: {'data': u'<p>found "\…

python unicode elementtree
Extracting text after tag in Python's ElementTree

Here is a part of XML: <item><img src="cat.jpg" /> Picture of a cat</…

python text xml-parsing elementtree
How to create <!DOCTYPE> with Python's cElementTree

I have tried to use the answer in this question, but can't make it work: How to create "virtual root" …

python xml elementtree
Creating a doctype with lxml's etree

I want to add doctypes to my XML documents that I'm generating with LXML's etree. However I cannot figure out …

python doctype lxml elementtree
Removing XML subelement tags with Python using elementTree and .remove()

Hi Stackoverflow Community, I would appreciate some guidance in adjusting my XML file with Python and the elementTree library. For …

python xml elementtree xml.etree
How to keep comments while parsing XML using Python / ElementTree

Currently using Python 2.4.3, and not allowed to upgrade I want to change the values of a given attribute in one …

python xml elementtree
Alternative XML parser for ElementTree to ease UTF-8 woes?

I am parsing some XML with the elementtree.parse() function. It works, except for some utf-8 characters(single byte character …

python xml utf-8 elementtree
Empty list returned from ElementTree findall

I'm new to xml parsing and Python so bear with me. I'm using lxml to parse a wiki dump, but …

python xml parsing elementtree wikimedia-dumps
Python element tree - extract text from element, stripping tags

With ElementTree in Python, how can I extract all the text from a node, stripping any tags in that element …

python xml-parsing elementtree
What are the differences between lxml and ElementTree?

When it comes to generating XML data in Python, there are two libraries I often see recommended: lxml and ElementTree …

python lxml elementtree