Advertisement
Guest User

Untitled

a guest
Apr 14th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import urllib, urllib2, cookielib, webbrowser
  2.  
  3. username = 'Firstname.lastname'
  4. password = 'Password'
  5. url = 'https://www.myhcl.com/Login/home.aspx'
  6. webbrowser.open(url, new=1, autoraise=1)
  7. cj = cookielib.CookieJar()
  8. opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  9. login_data = urllib.urlencode({'txtUserID' : username, 'txtPassword' :
  10. password})
  11. opener.open('https://www.myhcl.com/Login/home.aspx', login_data)
  12. resp = opener.open('https://www.myhcl.com/Login/home.aspx')
  13. print resp
  14. webbrowser.open(url, new=1, autoraise=1)
  15. #webbrowser.open_new('https://www.myhcl.com/Login/home.aspx')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement