I try to parse a large xml file with Python, but when I want to print CDATA information, there are nothing, especially with the "content" tag for the description
My source code look like this:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import xml.sax
import re
from cStringIO import StringIO
class MovieHandler( xml.sax.ContentHandler ):
def __init__(self):
self.item = {}
self.CurrentData = ""
self.url = ""
self.description = ""
self.price = ""
# Call when an element starts
def startElement(self, tag, attributes):
self.CurrentData = tag
# Call when an elements ends
def endElement(self, tag):
elif self.CurrentData == "url":
self.item["url"] =