Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-*-coding:utf8-*-
- import urllib
- import http.cookiejar
- url = 'https://joffice.jeunesseglobal.com/members/back_office.asp'
- login_url = "https://joffice.jeunesseglobal.com/login.asp"
- login_username = "jianghong181818"
- login_password = "Js@168168!"
- login_data = {
- "Username" : login_username,
- "pw" : login_password,
- }
- post_data = urllib.parse.urlencode(login_data).encode('utf-8')
- headers = {'User-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'}
- req = urllib.request.Request(login_url, headers = headers, data = post_data)
- cookie = http.cookiejar.CookieJar()
- opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cookie))
- resp = opener.open(req)
- print(resp.read().decode('utf-8'))
Add Comment
Please, Sign In to add comment