Pulling the bandwidth.csv file with python
Posted: Thu Jan 19, 2017 3:30 pm
So I'm trying to download the bandwidth.csv file. I know I have to post to get_password_cookie.sh keep the cookies and then ask for the file.
But having trouble doing it.
Any help?
# Read CSV File
url='http://mygargoylerouter/utility/get_password_cookie.sh'
s =requests.session()
p = dict(postparms = 'mygargoylepassword')
headers = {'content-type': 'application/x-www-form-urlencoded'}
r = s.post(url,params = p,headers=headers)
print r
print r.text
c = r.cookies
r = requests.get('http://mygargoylerouter/bandwidth.csv', cookies = c, verify = False)
Seems to pull back a page, but I don;t think I'm logged in.
But having trouble doing it.
Any help?
# Read CSV File
url='http://mygargoylerouter/utility/get_password_cookie.sh'
s =requests.session()
p = dict(postparms = 'mygargoylepassword')
headers = {'content-type': 'application/x-www-form-urlencoded'}
r = s.post(url,params = p,headers=headers)
print r
print r.text
c = r.cookies
r = requests.get('http://mygargoylerouter/bandwidth.csv', cookies = c, verify = False)
Seems to pull back a page, but I don;t think I'm logged in.