I'm trying to write a Python-Script which makes it possible to submit responses in Google-Forms like this one: https://docs.google.com/forms/d/152CTd4VY9pRvLfeACOf6SmmtFAp1CL750Sx72Rh6HJ8/viewform
But how to I actually send the POST and how can I find out, what this POST should actually contain?
I would use
urllib2
andurllib
to send the post.Do something like this:
you should structure it a bit like that.
To get the form names you need to look at the source code of the site and find the names of the forms you want to enter into and submit.
Hope this Helps
Good Luck:)
Based on the answer from @pigletfly I wrote a little script for harvesting the field names (for a text-field only form)
You can then use the get_questions function to get the fields which you can fill in
To get the questions (fields) as a dict
then use the submit_response with keyword arguments to submit
Here is my script which works:
First
pip install requests
You have to post some specific form data to a specific url,you can use requests.The form_data dict params are correspondent to options,if you don't need some options,just remove it from form_data.