0

so i am currently reading a file from s3 and i need to use etree.iterparse() for processing the xml. It is currently printing the whole xml . Is there is any way i can use etree.iterparse() from s3

txtFile = s3.get_object(Bucket=bucket, Key=process)
data = txtFile['Body'].read()
context = etree.iterparse(data,events=("end",), tag="data-Id")
for event, elem in context:
    elem.attrib.get("data-id")
Nithish Albin
  • 352
  • 5
  • 20

0 Answers0