Hello all, I'm trying to create this python script to login to my vpn website and download the settings zip so that I can back it up. Everything works until I get to the part where I download the zip itself. Everything completes fine with no errors but the zip is only 1kb wont open. It's normally 175kb. I'm using Python 3.5.2 and urllib. Any help is appreciated!
Code:
Code:
Code:
settingsURL = 'link to download file'
# grab the settings file
req = urllib.request.Request(settingsURL)
response = urllib.request.urlopen(req, context=bypass)
settingsFile = response.read()
response.close
print('Got settings file')
print('saving...')
# open the specified file in write binary mode, overwriting anything that was there before
saveFile = open(filePath, 'wb')
saveFile.write(settingsFile)
saveFile.close
print('settings file saved')
sys.exit()