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.
-
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
-
Launch directly using cmd:
python google_form_parser.py
- 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
For more you can always check the latest.log which will be created after your first launch
parsed JSON files and their source are located in FORMS folder with their form title
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:
At first page there are 2 types of forms
- No question, Only description
- Questions with description
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.
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.
For visualisation in line 82 set headless=False, so you can see the parsing process.
Clicking anywhere on browser while running with headless=False may occure problems.
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.
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
Parser will save it in questions same as section description, with text and styles
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.
Unfortunately parser is unable to parse some text question's answer verifications.
If your form is unparsable you can see it on latest.log
Also you can see the parser's last point with image
For inputs:
text is for text inputs. text questions are saved witn answer verification, if question has no answer verification it will save as "None"
textarea is for text area inputs.
if a multiple choice question has description text it will save with it's description same in checkbox
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.
DD is for dropdown.
LS is for linear scale. MCG is for Multiple Choice Grid. CBG is for CheckBox Grid.
Parser in unable to upload at this point.
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.