본문 바로가기

Computer/Programing

Clien login python 클리앙 로그인 파이썬


#참조 https://beomi.github.io/2017/01/20/HowToMakeWebCrawler-With-Login/




# -*- coding: UTF-8 -*-


import requests

from bs4 import BeautifulSoup as bs


LOGIN_INFO = {

    'userId': 'IDisHERE',

    'userPassword': 'PASSWORDisHERE'

}


with requests.Session() as s:

    first_page = s.get('https://www.clien.net/service')

    html = first_page.text

    soup = bs(html, 'html.parser')


    csrf = soup.find('input', {'name': '_csrf'}) 

    print(csrf['value']) 


    LOGIN_INFO.update({'_csrf':csrf['value']})

    print LOGIN_INFO


    login_req = s.post('https://www.clien.net/service/login', data=LOGIN_INFO)


    print(login_req.status_code)

#    if login_req.status_code != 200:

#        raise Exception('로그인이 되지 않았어요! 아이디와 비밀번호를 다시한번 확인해 주세요.')



'Computer > Programing' 카테고리의 다른 글

Windows cd-key finder by VBS  (0) 2021.08.24
MiTemp2 Read and write to SQL  (0) 2021.08.11
VS CODE  (0) 2020.03.01
Send image file to Telegram  (0) 2019.03.18
Python data structure 파이썬 자료구조  (0) 2019.02.07
Python load json from web  (0) 2019.02.07
Telegram URL 이용하여 문자 보내는법  (0) 2019.02.07
Python 실행값을 PHP로 불러오기  (0) 2019.02.07