I'm trying to use Python to download XML files from this site:
But the following examples are both leaving me with just an empty XML file. The first saves me an "InsecureRequestWarning" message but the outcome of both is the same.
r = requests.get('https://media.waec.wa.gov.au/2022%20North%20West%20Central%20By-Election%20-%20LA%20VERBOSE%20RESULTS.xml', verify='~ file path for locally saved site certificate PEM file ~')
r.raw.decode_content = True
with open('~ file path for saved file ~', 'wb') as f:
shutil.copyfileobj(r.raw, f)
r = requests.get('https://media.waec.wa.gov.au/2022%20North%20West%20Central%20By-Election%20-%20LA%20VERBOSE%20RESULTS.xml', verify=False)
r.raw.decode_content = True
with open('~ file path for saved file ~', 'wb') as f:
shutil.copyfileobj(r.raw, f)