Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import urllib, urllib2, cookieliz
  2.  
  3. #Usuario y contraseña
  4. username = 'email'
  5. password = 'contraseña'
  6.  
  7.  
  8. #Cookies
  9. cj = cookielib.CookieJar()
  10. opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  11. #Equivale a un POST
  12. login_data = urllib.urlencode({'username' : username, 'password' : password})
  13. opener.open('https://ppp.com/login', login_data)
  14.  
  15. #Reportes
  16. resp = opener.open('https://ppp.com/reports/csv/11777')
  17. content = resp.read()
  18. print content
  19.  
  20. "Inventory Name","Requests","Impressions","Fill Rate"
  21. "aaass MWasdS","569737093","244066","0.04"
  22. "bssss","331270265","381168","0.12"
  23. "cumbia","152492369","190008","0.12"
  24. "cuadrupedia","133983625","53184","0.04"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement