Automatický login s Requests

martin <[email protected]>
Newsgroups gmane.user-groups.linux.czech
Message-ID <[email protected]>
Ahoj, potřebuji automatické přihlášení na [1] web .

Pomocí develop nástrojů v Chrome jsem zjistil potřebná data

ale stále se mi vrací prázdný řetezec.

Potřeboval bych lehké nakopnutí.

Díky.

def page_login(user, passwd):

    url = "https://marshallcode.tools/member-dashboard/"
    header = { "user-agent": "Mozilla / 5.0(X11;Linux
    x86_64) AppleWebKit / 537.36(KHTML, like Gecko)
    Chrome81.0.4000.3Safari / 537.36" } values =
    {"login[user]": user, "login[user_password]": passwd,
    "doLogin": None}

    with requests.Session() as session: r = session.get(url,
    headers=header) print(r.content) p = session.post(url,
    data=values, headers=header) print(p.content)

1. https://marshallcode.tools/member-dashboard/


Zobrazit: http://www.abclinuxu.cz/poradna/programovani/show/451950
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.