Keyzz Test
pip install requests
from requests import session
payload = {
'action': 'login',
'id':'0165afeb-4a98-470c-a2d4-66dd806bde1d'
}
with session() as c:
c.post('http://206.189.52.145:5000/stage/', data=payload)
response = c.get('http://206.189.52.145:5000/stage/login?id=0165afeb-4a98-470c-a2d4-66dd806bde1d')
print(response.headers)
print(response.text)
!pip install bs4==0.0.1
!pip install bs4==0.0.1
from requests import Session
from bs4 import BeautifulSoup as bs
with Session() as s:
site = s.get("http://206.189.52.145:5000/stage/login")
bs_content = bs(site.content, "html.parser")
token = bs_content.find("input", {"name":"csrf_token"})["value"]
login_data = {"username":"admin","password":"12345", "csrf_token":token}
s.post("http://206.189.52.145:5000/stage/login",login_data)
home_page = s.get("http://206.189.52.145:5000/stage")
print(home_page.content)