[Python] Attempting to POST to Google Form with login

Discussão em 'Python' iniciado por Stack, Dezembro 18, 2024.

  1. Stack

    Stack Membro Participativo

    I saved cookies from when I manually logged into a google account, and I need them for a form that requires the user to be logged in.

    The form is pretty simple. It asks for the users information and a few random questions. I can easily get the form elements and create the data like so:

    enterData = {
    "emailAddress":"emailhere@gmail.com",
    "dlut":"1734495396",
    "submissionTimestamp":"1734503245",
    "entry.466815253_sentinel":"",
    "token":"redacted",
    "hud":"true",
    "fvv":"1",
    "partialResponse":"[null,null,\"-2993399899787926559\"]",
    "pageHistory":"0",
    "fbzx":"-2993399899787926559",
    "entry.2006548712":"answer1",
    "entry.526914826":"answer2",
    "entry.481670044":"answer3",
    "entry.114368998":"answer4",
    "entry.346692381":"123 main st",
    "entry.93217058":"",
    "entry.657953517":"Chesterfield",
    "entry.1938294066":"MO",
    "entry.1075043656":"63017-5428",
    "entry.466815253":"11"
    }


    These are the exact inputs required for Google Forms, and this is the URL to post to: https://docs.google.com/forms/u/0/d...M7qYyXv0QyXShg5WfawQIAbn3wgPqAcg/formResponse

    And this is the code being used to post it:

    url = 'https://docs.google.com/forms/u/0/d/e/1FAIpQLSeQTjQNyWj1RidzWyM7qYyXv0QyXShg5WfawQIAbn3wgPqAcg/formResponse'
    resp = session.post(url=url, data=enterData)


    The request receives a 200 status code so theres no issues with authentication, but it doesn't actually post to the form. The HTML response shows that the form elements are filled in, but they're not actually being sent for some reason. I can't figure out why it would be filling in the form but not actually sending it. Any help would be appreciated.

    Continue reading...

Compartilhe esta Página