Skip to content

Instantly share code, notes, and snippets.

@icecore2
Created June 1, 2020 06:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icecore2/987945be7a842e010332a674d25cf281 to your computer and use it in GitHub Desktop.
Save icecore2/987945be7a842e010332a674d25cf281 to your computer and use it in GitHub Desktop.
This script is for filling the google forms automatically by entry ID and value. This includes Date, ID and Full name, need modify only the ID and the Full name between the brackets.
''' This script is for filling the google forms automatically by entry ID and value.
This includes Date, ID and Full name, need modify only the ID and the Full name between the brackets.
'''
import requests
from datetime import datetime
url = 'https://docs.google.com/forms/d/<ID>/formResponse' # Change the ID to a proper one
date = datetime.now()
year = date.year
month = date.month
day = date.day
my_id = "" # ID between the brackets
full_name = "" # Full name between the brackets
# print(date.year ,"/" ,month , "/",day, "id: ", my_id, "fname:", full_name)
form_data = {'entry.1489836390_day':day,
'entry.1489836390_year':year,
'entry.1489836390_month':month,
'entry.1181100632':'כן',
'entry.949846978':'כן',
'entry.2064648594':my_id,
'entry.476615008':full_name}
# Change the ID to a proper one
user_agent = {'Referer':'https://docs.google.com/forms/d/<ID>/viewform','User-Agent': "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36"}
r = requests.post(url, data=form_data, headers=user_agent)
# print(r.raise_for_status())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment