Guest User

Untitled

a guest
Mar 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. from requests import session
  2.  
  3. # ex) ID = abcd / PW = 1234
  4.  
  5. payload = {
  6. 'ctl00$ContentPlaceHolder1$tbxLoginID' : 'abcd',
  7. 'ctl00$ContentPlaceHolder1$tbxLoginPW' : '1234'
  8. }
  9.  
  10. with session() as c:
  11. c.post('http://www.kif.re.kr/kif2/login/login.aspx', data=payload)
  12. response = c.get('What should I write here?')
  13. # response = c.get('http://example.com/protected_page.php')
  14. print(response.headers)
  15. print(response.text)
  16.  
  17. payload = {
  18. '__LASTFOCUS': '',#empty
  19. '__VIEWSTATE': 'get this value from the login page source',
  20. '__VIEWSTATEGENERATOR': 'get this value from the login page source',
  21. '__EVENTTARGET': '',#empty
  22. '__EVENTARGUMENT': '',#empty
  23. '__EVENTVALIDATION': 'get this value from the login page source',
  24. 'ctl00$agentPlatform': '1',
  25. 'ctl00$menu_nav1$tbxSearchWord': '',#empty
  26. 'ctl00$ContentPlaceHolder1$radiobutton': '0',
  27. 'ctl00$ContentPlaceHolder1$tbxLoginID': 'abcd',
  28. 'ctl00$ContentPlaceHolder1$tbxLoginPW': '1234',
  29. 'ctl00$ContentPlaceHolder1$ibtnLogin.x': '36', #i think this is the mouse cursor position
  30. #when clicked on login, not sure if its necessary
  31. 'ctl00$ContentPlaceHolder1$ibtnLogin.y': '25'
  32. }
Add Comment
Please, Sign In to add comment