Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from requests import session
- # ex) ID = abcd / PW = 1234
- payload = {
- 'ctl00$ContentPlaceHolder1$tbxLoginID' : 'abcd',
- 'ctl00$ContentPlaceHolder1$tbxLoginPW' : '1234'
- }
- with session() as c:
- c.post('http://www.kif.re.kr/kif2/login/login.aspx', data=payload)
- response = c.get('What should I write here?')
- # response = c.get('http://example.com/protected_page.php')
- print(response.headers)
- print(response.text)
- payload = {
- '__LASTFOCUS': '',#empty
- '__VIEWSTATE': 'get this value from the login page source',
- '__VIEWSTATEGENERATOR': 'get this value from the login page source',
- '__EVENTTARGET': '',#empty
- '__EVENTARGUMENT': '',#empty
- '__EVENTVALIDATION': 'get this value from the login page source',
- 'ctl00$agentPlatform': '1',
- 'ctl00$menu_nav1$tbxSearchWord': '',#empty
- 'ctl00$ContentPlaceHolder1$radiobutton': '0',
- 'ctl00$ContentPlaceHolder1$tbxLoginID': 'abcd',
- 'ctl00$ContentPlaceHolder1$tbxLoginPW': '1234',
- 'ctl00$ContentPlaceHolder1$ibtnLogin.x': '36', #i think this is the mouse cursor position
- #when clicked on login, not sure if its necessary
- 'ctl00$ContentPlaceHolder1$ibtnLogin.y': '25'
- }
Add Comment
Please, Sign In to add comment