Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, urllib2, cookieliz
- #Usuario y contraseña
- username = 'email'
- password = 'contraseña'
- #Cookies
- cj = cookielib.CookieJar()
- opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
- #Equivale a un POST
- login_data = urllib.urlencode({'username' : username, 'password' : password})
- opener.open('https://ppp.com/login', login_data)
- #Reportes
- resp = opener.open('https://ppp.com/reports/csv/11777')
- content = resp.read()
- print content
- "Inventory Name","Requests","Impressions","Fill Rate"
- "aaass MWasdS","569737093","244066","0.04"
- "bssss","331270265","381168","0.12"
- "cumbia","152492369","190008","0.12"
- "cuadrupedia","133983625","53184","0.04"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement