I'm trying to connect to the following website with requests
(in Python) - link.
I'm really new to dealing with web from Python so I have no idea what to do. As I understand (although I'm not sure) we need to create a certificate that contains the username and the password. I got the content of the page as follows:
r = requests.get(url,verify=False)
But I don't understand how to connect. Furthermore, how to keep the session alive so I could enter another page on the website and it won't ask for the username and password again?
EDIT: from previous thread I learn that I need to do something like:
import requests
LOGIN = 'https://www.hackthis.co.uk/index.php?login'
PROTECTED_PAGE = 'https://www.hackthis.co.uk/news'
payload = {
'username': 'VALIDUSERNAME',
'password': 'VALIDPASSWORD'
}
with requests.session() as s:
s.post(LOGIN, data=payload)
response = s.get(PROTECTED_PAGE)
print(response.text)
So i did:
payload = {
'TapuzLogin1$ctl01$UserName': 'USER',
'TapuzLogin1$ctl01$Password': 'PASS'
}
with requests.Session() as s:
p = s.post("https://www.tapuz.co.il/Common/SignInPage.aspx", verify=False,data=payload)
print(p.text)
But it doesn't connect. Should the username field be TapuzLogin1$ctl01$UserName
and the password field TapuzLogin1$ctl01$Password
? Also, Should I press connect afterwards or that should to the trict?