Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, urllib2, cookielib, webbrowser
- username = 'Firstname.lastname'
- password = 'Password'
- url = 'https://www.myhcl.com/Login/home.aspx'
- webbrowser.open(url, new=1, autoraise=1)
- cj = cookielib.CookieJar()
- opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
- login_data = urllib.urlencode({'txtUserID' : username, 'txtPassword' :
- password})
- opener.open('https://www.myhcl.com/Login/home.aspx', login_data)
- resp = opener.open('https://www.myhcl.com/Login/home.aspx')
- print resp
- webbrowser.open(url, new=1, autoraise=1)
- #webbrowser.open_new('https://www.myhcl.com/Login/home.aspx')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement