testjszf.py 447 B

123456789101112131415161718
  1. import xml.etree.ElementTree as ET
  2. import base64
  3. tree = ET.parse("/Users/xiaopengzhang/Downloads/qingdan/front/test.jszf")
  4. root = tree.getroot()
  5. for child in root:
  6. if child.tag == "ZBFileContent":
  7. ##print(child.text)
  8. base64_bytes = child.text.encode("ascii")
  9. sample_string_bytes = base64.b64decode(base64_bytes)
  10. with open("example.zip", "wb") as file:
  11. file.write(sample_string_bytes)