Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NODRIVER: how i can use nodriver to login and capture every https and cookies when login?? #1888

Open
marioeivissa opened this issue May 18, 2024 · 2 comments

Comments

@marioeivissa
Copy link

any help?, cant find the way to login with nodriver and get cookies and every https in the response, like when login and we use f12 and we see all response all https and all cookies??' thanks

@jwwq
Copy link

jwwq commented May 22, 2024

You should register some handlers for network events. There is a 'network_monitor.py' example, also you can check out #1832, there's a sample of working code there.

@marioeivissa
Copy link
Author

You should register some handlers for network events. There is a 'network_monitor.py' example, also you can check out #1832, there's a sample of working code there.

no mate im using mitmproxy with a script like this mitmproxy_1.py import json
from mitmproxy import http

def response(flow: http.HTTPFlow) -> None:
if flow.request.pretty_url == "https://.apps..pt/Services/Authentication/User.svc/GetToken":
try:
response_data = json.loads(flow.response.text)
result_value = response_data.get('Result')
if result_value:
print("Valor de 'Result' encontrado en la respuesta:", result_value)
# Guardar el token en un archivo JSON
with open('tokensportmeo.json', 'w') as file:
json.dump({'token': result_value}, file)
print("Token guardado en tokensportmeo.json")
else:
print("No se encontró el valor de 'Result' en la respuesta.")
except json.JSONDecodeError as e:
print(f"Error al decodificar JSON en la respuesta: {e}")

and not working in linux, working perfect in windows not in linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants