0

I have files in XML format saved in S3 bucket and I want to parse them with xml.etree inside a Sagemaker's Notebook Instance. I tried the following but it produces FileNotFoundError:

data_location = `s3://data-bucket/1.xml`
xml.etree.ElementTree.parse(data_location)
Sowjanya R Bhat
  • 1,128
  • 10
  • 19
Ivona Tau
  • 1,032
  • 1
  • 10
  • 20
  • So your question is *"How to read data from `s3://` URLs in Python?"* – Tomalak Jun 29 '20 at 09:44
  • No, my question is how to parse XML files in Sagemaker notebook from file location in S3. – Ivona Tau Jun 29 '20 at 09:46
  • No, that's not your question. Try the solution in the duplicate I linked to. Parsing the XML is not the problem here. – Tomalak Jun 29 '20 at 09:47
  • ...or to put it differently, `s3://` is not a form of URL that Python can read without help from some sort of library. Once you have that in place, parsing the XML will work as you would expect it. – Tomalak Jun 29 '20 at 09:59

0 Answers0