Skip to content

corazonthedev/Google-form-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parser_logo

Overview

This is a python code for parsing Google forms into JSON files.

This parser is not a finished project, there may be unseen bugs or errors. You can contribute as you like.

Requirements

Installation and Launching

  1. Clone the repository:

    git clone https://github.com/corazonthedev/Google-form-parser.git
    cd Google-form-parser
    pip install -r requirements.txt
    python google_form_parser.py
  2. Launch directly using cmd:

    python google_form_parser.py

How to use

1

  • Enter your gmail
  • Enter your password
  • Enter form link
  • Submit

Note: Parser is currently unable to tell is your link/email/password valid or not. So be sure about your inputs or it will not work.

Parser will automatically parse the form 2

and exit 3

For more you can always check the latest.log which will be created after your first launch

4 5

parsed JSON files and their source are located in FORMS folder with their form title

6 7

8

Note: There is a loop in parser and link.txt file in order to parse multiple forms at once but after a couple of forms it`s bugging and not parsing, it will be fixed in future.

example forms you can use:

Try with everything

form with sections

internship application

How does it work

At first page there are 2 types of forms

  1. No question, Only description

10

  1. Questions with description

11

If there are no visible questions on first page, parser will just parse the description and next.

Otherwise parser will try to fill every question and parse it.

Note: Parser will try to fill every question because it will also parse the Answer Verifications. 12

When parser finishes filling out questions on current page, it will next and loop untill the last page.

Note: Currently some forms are unparsable because of Google form's html-js structure. If your form is unparsable it will say UNPRASABLE on latest.log.

Visualisation

For visualisation in line 82 set headless=False, so you can see the parsing process. 9

Clicking anywhere on browser while running with headless=False may occure problems.

How to read JSON

debug form

Parser firstly save form title, section title (if available) and description text. Description text will be divided into text and style. In text you can see each line of text with different styles. In styles you can see which line has which styles.

Note: This can also be done with saving each line with their style.

First section:

1 2

Second Section:

3 4

Parser will save every question's text. And if a question is mandatory it will add ***** at the end of question text (can be improved)

If question has a description

a

Parser will save it in questions same as section description, with text and styles

6

Note: Parser is currently unable to save question texts with styles, for example: if a link is present in question text parser will not save it properly.

9 10

Unfortunately parser is unable to parse some text question's answer verifications.

If your form is unparsable you can see it on latest.log

11

Also you can see the parser's last point with image

12

For inputs:

8

text is for text inputs. text questions are saved witn answer verification, if question has no answer verification it will save as "None"

13 14

textarea is for text area inputs.

15 16

Third Section:

if a multiple choice question has description text it will save with it's description same in checkbox

17 18

For inputs:

MC is for multiple choice and MCT is for multiple choice with "other" option. CB is for checkbox and CBT is for checkbox with "other" option.

19

DD is for dropdown.

20 21 22

Fourth Section:

23

24

25

LS is for linear scale. MCG is for Multiple Choice Grid. CBG is for CheckBox Grid.

Fifth section:

26

27

Parser in unable to upload at this point.

Disclaimer:

Why do I have to log-in ?

You have to log-in your Google account because you can access Google forms only if you loged-in (there are some public forms which you can access without logging-in but not most of them)

THIS PARSER DOES NOT SAVE OR KEEP YOUR EMAIL OR PASSWORD.

Although it only works with your manuel input I highly recommend not to use your main account.

I tried different ways to access Google forms but wihout logging-in you can't view all form pages. If you do have an idea you can contribute to this parser.

About

Google form to JSON parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages