Guide to automating Google form submissions.
The automated.py
script scrapes forms and automates the setup/submission process for you.
If this doesn't work try the manual method.
(Requires Python 3.10 as well as BeautifulSoup and Requests)
1. Fill out the form.
2. Select CTRL + SHIFT + I
to open devtools
This is the same place you'd go to for Inspect Element. Locate and select the Network panel.
3. Submit the form.
You should see several entries appear in the Network panel. Select the one that says formResponse
. This should open up a new menu on the side.
On Chrome, this might look a little bit different:
4. In the side menu, copy the url under the Headers tab
This should be the first thing you see after opening the formResponse
entry.
On Chrome:
5. Under the Request/Payload tab, copy the entries that correspond to your form submission.
On Firefox the tab is called "request", while on chrome it's called "payload."
6. Fill this information into your script.
URL
is the url copied from the headers tab
DATA
is a dictionary of the payload/request info.
You can change the values to whatever you want as long as the form permits it.
Python example:
import requests
URL = 'https://docs.google.com/forms/....../formResponse'
DATA = {
'entry.1251875408':'Answer 1', # Answer for Question 1
'entry.1304624064':'python text entry' # Answer for Question 2
}
res = requests.post(URL, DATA)
print(res.status_code, res.reason)
NodeJS example using the the Request library:
const request = require('request');
const URL = 'https://docs.google.com/forms/....../formResponse';
const DATA = {
'entry.1251875408':'Answer 1', // Answer for Question 1
'entry.1304624064':'javascript text entry' // Answer for Question 2
}
request({
url:URL,
method:'POST',
form:DATA,
}, function (error, res) {
if (error) console.error(error)
else console.log(res.statusCode, res.statusMessage)
})
7. Run
200
Submission went through. Great success!400
Bad request. You might've forgotten a required question, or submitted a multiple choice option that doesn't exist.404
Not found. Your form doesn't exist. Maybe you copied the url wrong.405
Method not allowed. Probably messed something up, definitely a skill issue.429
Rate limited. You're trolling too hard.