├── GoogleFormFill.py └── README.md /GoogleFormFill.py: -------------------------------------------------------------------------------- 1 | import urllib,urllib2 2 | 3 | data = "" #Text you have to fill in the form. You can also read a file and fill its content in a google form. 4 | 5 | url="https://docs.google.com/forms/d/XXXXXXXXXXXXXXXXXXXXXXX/formResponse" #URL to the form you want to fill. FormResponse should be used instead of ViewForm 6 | 7 | text_entry_field={'entry.XXXXXXX':data} #Specify the Field Name here 8 | 9 | """ 10 | Hop to your form page, and click Responses > Get pre-filled URL. It'll ask you to do a sample fill-out of your form. I'd suggest putting in responses that easily let you see what question you're answering. Once you hit submit, it's going to give you a URL in the form of... 11 | https://docs.google.com/forms/d//viewform?entry.XXXXXXX=____&entry.YYYYYY=____... 12 | Now, change viewform to formResponse within the URL. 13 | """ 14 | 15 | try: 16 | dataenc=urllib.urlencode(text_entry_field) 17 | req=urllib2.Request(url,dataenc) 18 | response=urllib2.urlopen(req) 19 | data='' 20 | except Exception as e: 21 | print e -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automate-Google-Form-Fill 2 | Python code to automate the filling of google form. 3 | --------------------------------------------------------------------------------