I am studying crawling using Python.
My goal is to download the file.
I am studying login now and it is very difficult.
For example, I need to log in to download files from this site.
I looked up various information.
Login to website using python
But the site I want seems a bit different.
I was able to crawl most sites that do not require login.
However, I can not crawl sites that require login.
So I really want to study that part.
My goal is to log in and then view the code in html for crawling.
Below is my code. Is this the right thing to do?
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)