Does anyone know how I can retrieve an HTTPS page to a file, that I can then later parse using EG?
I think if I could use the urlretrieve function in urrlib, that would work, except this is for an HTTPS page, so I used urllib2 instead, but it doesn't have the retrieve function. I was thinking of using this, and then adding Pako's write file plugin to drive the results out to a file, but I had trouble getting the output of the script mapped into the file.
here is what i have for a script so far... but I don't know how to get the results out to a file (or even see if it's working for that matter).
Code: Select all
import urllib2, base64
request = urllib2.Request("https://www.myevolutionconnex.bryant.com/MyLocations")
base64string = base64.encodestring('%s:%s' % ('username', 'password')).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)Thanks for any help you can provide.
UPDATE 1:
So I was able to get the page saved off to a file, but unfortunately, the authentication is not working - so I think I have to go a different route.