Advertisement
Guest User

lorauth

a guest
Jan 14th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import urllib
  2. from http import cookiejar
  3.  
  4. def main():
  5.     cookie = cookiejar.CookieJar()
  6.     req = urllib.request.build_opener(
  7.             urllib.request.HTTPCookieProcessor(cookie))
  8.     urllib.request.install_opener(req)
  9.  
  10.     par = urllib.parse.urlencode({
  11.         'nick':'evilmanul',
  12.         'passwd':'my_password'}).encode('utf-8') # параметры
  13.     resp = req.open('https://linux.org.ru', par)
  14.     print(resp.read().decode("utf-8"))
  15. if __name__ == '__main__':
  16.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement