Answer the question
In order to leave comments, you need to log in
Python. How to log in to the site and get arguments from the url ??
Good afternoon.
There is a simple login and password form. After a successful login, info appears that the authorization is successful and the arguments user_name, user_id are added to the url.
How can I get their values?
thanks in advance
import requests
data = {"login_username":"aghgd15", "login_password":"123654"}
url = "http://localhost/login.html"
s = requests.Session()
s = requests.post(url, data=data)
print(s)
Answer the question
In order to leave comments, you need to log in
Where is the information coming out? After redirects or what?
allow_redirects=True pass in the request
Should help :)
from urllib.parse import urlparse, parse_qs
r = urlparse(s.url)
p = parse_qs(r.query)
print(p['user_name'], p['user_id'])
there is documentation for the ISP panel en.5.ispdoc.com/index.php/%D0%9A%D0%BE%D0%BD%D1%82...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question