I made a Python code using requests,requests_toolbelt module.
The code get HTML response from webpage behind login and I save HTML response in page.
Then I open it with web browser , so I dont see button "update" on browser webpage , it
s on the code of page , but I don`t see it when I browse saved page with browser , so what to do to be able to see that button “update” on the response HTML saved page,
regional page is: text
login info:
email: [email protected]
password: 123456
My Python code:
import requests
from requests_toolbelt.utils import dump
#login api page
url1 = f'https://signup.com/api/users/login'
#page i want access
url4 = f"https://signup.com/Profile"
#authentication information
payload = {
'email': '[email protected]',
'password': '123456'
}
# Use 'with' to ensure the session context is closed after use.
with requests.Session() as s:
p = s.post(url1, data=payload)
# print the HTML returned or something more intelligent to see if it's a successful login page.
#print(p.text)
# An authorised request.
r = s.get(url4)
data = dump.dump_all(r)
# data = dump.dump_response(r)
print(data.decode('utf-8'))
I expect to see button “update” in saved HTML response page.
malik alfutaisy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3