DEV Community

Discussion on: How I Automated The Google Form Filling For My College Attendance Using Python

Collapse
 
dipakp2726 profile image
dipakp2726

its not working in form which has set response receipt always,

Collapse
 
jamesshah profile image
James Shah

No that's not the case. As I've tried it on such form which sends a response receipt.

Collapse
 
kolcun profile image
Mike Kolcun

I'm having the same issue with a test form. If I set "response receipts" to "Always" I only ever get error 400. if I set "response receipts" to "If respondent requests it" I am able to get the form to submit.

Any thoughts?

Collapse
 
dipakp2726 profile image
dipakp2726

try again bro, i have tried today, its working when i disable this option and getting error 400 when i activate it

Thread Thread
 
minzhekang profile image
Kang Min Zhe

The reason why you are getting a response error of 400 is because when using the requests module, the posted data is automatically url encoded. Hence posting options that contains characters such as "+", "@" ..etc will cause a bad form error.

Hence, one way you can work around this is to have the request post http URL instead by passing a string.

string = "entry.xxx=Option+1&entry.xxx=option2"
r = requests.post(url, params = string)

Hope this helps.