About 97,600 results
Open links in new tab
  1. python - How can I parse XML and get instances of a particular …

    Python has an interface to the expat XML parser. xml.parsers.expat It's a non-validating parser, so bad XML will not be caught. But if you know your file is correct, then this is pretty good, and …

  2. What is the fastest way to parse large XML docs in Python?

    Try to use xml.etree.ElementTree which is implemented 100% in C and which can parse XML without any callbacks to python code. After the document has been parsed, you can filter it to …

  3. python - Which XML library for what purposes? - Stack Overflow

    Nov 8, 2014 · 8 A search for "python" and "xml" returns a variety of libraries for combining the two. This list probably faulty: xml.dom xml.etree xml.sax xml.parsers.expat PyXML beautifulsoup? …

  4. Python xml ElementTree from a string source? - Stack Overflow

    Mar 15, 2009 · The ElementTree.parse reads from a file, how can I use this if I already have the XML data in a string? Maybe I am missing something here, but there must be a way to use the …

  5. Parsing XML with namespace in Python via 'ElementTree'

    47 Note: This is an answer useful for Python's ElementTree standard library without using hardcoded namespaces. To extract namespace's prefixes and URI from XML data you can …

  6. python - xml.etree.ElementTree.ParseError -- exception handling …

    Dec 21, 2017 · Python ElementTree support for parsing unknown XML entities? But, if you are able to switch to lxml, its XMLParser() can work in the "recover" mode that would "ignore" the …

  7. What is a good XML stream parser for Python? - Stack Overflow

    Another option is using xml.sax. The official manual is too formal to me, and lacks examples so it needs clarification along with the question. Default parser module, xml.sax.expatreader, …

  8. Converting XML to JSON using Python? - Stack Overflow

    Oct 10, 2008 · That being said, Python's standard library has several modules for parsing XML (including DOM, SAX, and ElementTree). As of Python 2.6, support for converting Python data …

  9. How can I convert XML into a Python object? - Stack Overflow

    47 I need to load an XML file and convert the contents into an object-oriented Python structure. I want to take this:

  10. Faithfully Preserve Comments in Parsed XML - Stack Overflow

    I'd like to preserve comments as faithfully as possible while manipulating XML. I managed to preserve comments, but the contents are getting XML-escaped. #!/usr/bin/env python # …