├── config.txt ├── input.docx ├── output.pdf ├── input1.docx ├── static ├── bg.jpeg ├── logo.png ├── prem.jpeg ├── sneha.jpg ├── shruti.jpeg ├── formcss.css ├── style.css └── scripts │ └── formscripts.js ├── README.md ├── templates ├── homepage.html └── formhtml.html ├── formflask.py ├── output.py └── linkedin_scraper.py /config.txt: -------------------------------------------------------------------------------- 1 | #username 2 | #password -------------------------------------------------------------------------------- /input.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/input.docx -------------------------------------------------------------------------------- /output.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/output.pdf -------------------------------------------------------------------------------- /input1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/input1.docx -------------------------------------------------------------------------------- /static/bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/static/bg.jpeg -------------------------------------------------------------------------------- /static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/static/logo.png -------------------------------------------------------------------------------- /static/prem.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/static/prem.jpeg -------------------------------------------------------------------------------- /static/sneha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/static/sneha.jpg -------------------------------------------------------------------------------- /static/shruti.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shrutikumar15/Resume-Builder-from-LinkedIn/HEAD/static/shruti.jpeg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Resume-Builder-from-LinkedIn 2 | Builds Resume by scraping data from LinkedIn using Flask. 3 | 4 | ## Libraries Used 5 | 6 | > BeautifulSoup 7 | 8 | > selenium 9 | 10 | > re 11 | 12 | > json 13 | 14 | > time 15 | 16 | > docx 17 | 18 | > docx2pdf 19 | 20 | > flask 21 | 22 | > os 23 | 24 | ## Requirements 25 | 26 | > Python 3.x 27 | 28 | > Pip 29 | 30 | > chromedriver 31 | 32 | > Microsoft Office 2019 33 | 34 | ## Installation 35 | 36 | ### Clone 37 | Clone this repo to your local machine using 38 | > git clone https://github.com/shrutikumar15/Resume-Builder-from-LinkedIn.git 39 | 40 | ### Chrome Web Driver 41 | The Chrome Driver can be found here: https://chromedriver.chromium.org/downloads 42 | 43 | ### Setup 44 | Install BeautifulSoup 45 | ``` 46 | pip install beautifulsoup4 47 | ``` 48 | 49 | Install Selenium 50 | ``` 51 | pip install selenium 52 | ``` 53 | 54 | Install docx 55 | ``` 56 | pip install docx 57 | ``` 58 | 59 | Install docx2pdf 60 | ``` 61 | pip install docx2pdf 62 | ``` 63 | 64 | Install flask 65 | ``` 66 | pip install Flask 67 | ``` 68 | 69 | 70 | ## Usage 71 | 72 | * Edit the 'config.txt' file and add your linkedin username and password 73 | > This is required because linkedin requires a login before you can view a profile 74 | 75 | * Run the Python Program 76 | > python formflask.py 77 | 78 | * Enter the link of the profile that is to be scraped. 79 | 80 | * Output of the program is saved in pdf file named 'output.pdf' 81 | 82 | ## Screenshots 83 | 11 84 | link 85 | 86 | form11 87 | form12 88 | form2 89 | form 3 90 | form4 91 | form5 92 | form6 93 | form7 94 | form8 95 | form9 96 | 97 | ## Output 98 | resume2 99 | -------------------------------------------------------------------------------- /static/formcss.css: -------------------------------------------------------------------------------- 1 | /*custom font*/ 2 | @import url(https://fonts.googleapis.com/css?family=Montserrat); 3 | 4 | /*basic reset*/ 5 | * {margin: 0; padding: 0;} 6 | 7 | html { 8 | height: 100%; 9 | /*Image only BG fallback*/ 10 | 11 | /*background = gradient + image pattern combo*/ 12 | background: 13 | linear-gradient(rgba(87, 202, 255, 0.6), rgba(230, 229, 229, 0.863)); 14 | 15 | 16 | 17 | background-attachment: fixed; 18 | } 19 | body { 20 | font-family: montserrat, arial, verdana; 21 | } 22 | /*form styles*/ 23 | #msform { 24 | width: 710px; 25 | margin: 50px auto; 26 | 27 | position: relative; 28 | } 29 | #msform fieldset { 30 | background: white; 31 | border: 0 none; 32 | border-radius: 3px; 33 | box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4); 34 | padding: 20px 0px; 35 | box-sizing: content-box; 36 | width: 550px; 37 | margin-left: 90px; 38 | 39 | /*stacking fieldsets above each other*/ 40 | position: relative; 41 | } 42 | /*Hide all except first fieldset*/ 43 | #msform fieldset:not(:first-of-type) { 44 | display: none; 45 | } 46 | /*inputs*/ 47 | #msform input { 48 | padding: 15px; 49 | border: 1px solid #ccc; 50 | border-radius: 3px; 51 | margin-bottom: 10px; 52 | width: 350px; 53 | box-sizing: border-box; 54 | font-family: montserrat; 55 | color: #2C3E50; 56 | font-size: 15px; 57 | word-wrap: break-word; 58 | overflow-y: hidden 59 | } 60 | #msform textarea { 61 | padding: 15px; 62 | border: 1px solid #ccc; 63 | border-radius: 3px; 64 | margin-bottom: 10px; 65 | width: 350px; 66 | box-sizing: border-box; 67 | font-family: montserrat; 68 | color: #2C3E50; 69 | font-size: 15px; 70 | word-wrap: break-word; 71 | overflow-y: hidden 72 | } 73 | #msform label{ 74 | font-family: montserrat; 75 | width: 100px; 76 | font-family: montserrat; 77 | color: #2C3E50; 78 | font-size: 16px; 79 | } 80 | #msform .labeldiv{ 81 | padding-top: 21px; 82 | 83 | width:110px; 84 | } 85 | /*buttons*/ 86 | #msform .action-button { 87 | width: 100px; 88 | background: rgb(14, 128, 235); 89 | font-weight: bold; 90 | color: white; 91 | text-align: center; 92 | border: 0 none; 93 | border-radius: 1px; 94 | cursor: pointer; 95 | padding: 10px 5px; 96 | margin: 10px 5px; 97 | } 98 | #msform .add,#msform .remove { 99 | width: 100px; 100 | background-color: white; 101 | font-weight: bold; 102 | color: rgb(14, 128, 235); 103 | text-align: center; 104 | border-color: rgb(14, 128, 235); 105 | border: 0 none; 106 | border-radius: 1px; 107 | cursor: pointer; 108 | padding: 10px 5px; 109 | margin: 10px 5px; 110 | } 111 | 112 | #msform .action-button:hover, #msform .action-button:focus { 113 | box-shadow: 0 0 0 2px white, 0 0 0 3px rgb(14, 128, 235); 114 | } 115 | /*headings*/ 116 | .fs-title { 117 | text-align: center; 118 | font-size: 15px; 119 | text-transform: uppercase; 120 | color: #2C3E50; 121 | margin-bottom: 10px; 122 | } 123 | .fs-subtitle { 124 | font-weight: normal; 125 | font-size: 13px; 126 | color: #666; 127 | margin-bottom: 20px; 128 | text-align: center; 129 | } 130 | /*progressbar*/ 131 | #progressbar { 132 | margin-bottom: 30px; 133 | overflow: hidden; 134 | text-align: center; 135 | /*CSS counters to number the steps*/ 136 | counter-reset: step; 137 | } 138 | #progressbar li { 139 | list-style-type: none; 140 | color: black; 141 | text-transform: uppercase; 142 | font-size: 8px; 143 | width: 11.11%; 144 | float: left; 145 | position: relative; 146 | } 147 | #progressbar li:before { 148 | content: counter(step); 149 | counter-increment: step; 150 | width: 20px; 151 | line-height: 20px; 152 | display: block; 153 | font-size: 10px; 154 | color: #333; 155 | background: white; 156 | border-radius: 3px; 157 | margin: 0 auto 5px auto; 158 | } 159 | /*progressbar connectors*/ 160 | #progressbar li:after { 161 | content: ''; 162 | width: 100%; 163 | height: 2px; 164 | background: white; 165 | position: absolute; 166 | left: -50%; 167 | top: 9px; 168 | z-index: -1; /*put it behind the numbers*/ 169 | } 170 | #progressbar li:first-child:after { 171 | /*connector not needed before the first step*/ 172 | content: none; 173 | } 174 | /*marking active/completed steps green*/ 175 | /*The number of the step and the connector before it = green*/ 176 | #progressbar li.active:before, #progressbar li.active:after{ 177 | background: rgb(14, 128, 235); 178 | color: white; 179 | } 180 | .hide { 181 | display:none; 182 | } 183 | .form{ 184 | 185 | } 186 | 187 | .flex-container { 188 | display: flex; 189 | flex-direction: row; 190 | justify-content: center; 191 | } 192 | .fill-width { 193 | flex: 1; 194 | } 195 | .hidden_data{ 196 | font-size: 0px; 197 | } -------------------------------------------------------------------------------- /templates/homepage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Resume Builder 5 | 6 | 7 | 8 | 9 | 10 |
11 | 52 |
53 |

Got a LinkedIn Profile?
Build your Resume For Free!

54 | Build Now 55 |
56 |
69 |

Our Team

70 |
71 |
72 |
73 | Pdem 74 |
75 |

Prem Nagdeo

76 |

Co-Founder

77 |

premnagdeo@gmail.com

78 |
79 |
80 |
81 |
82 |
83 | Shrutz 84 |
85 |

Shruti Kumar

86 |

Co-Founder

87 |

shrutikumar.001@gmail.com

88 |
89 |
90 |
91 |
92 |
93 | Sneh 94 |
95 |

Sneha Rohra

96 |

Co-Founder

97 |

sneha.rohra99@gmail.com

98 |
99 |
100 |
101 |
102 | 103 | 104 | -------------------------------------------------------------------------------- /templates/formhtml.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Resume Builder 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 46 | 47 | 48 |
49 |
50 |

Personal Details

51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | 84 |
85 | 86 |
87 |
88 |
89 | 90 |
91 |
92 |

Education Details

93 | 94 |
95 | 96 |
97 |
98 |
99 |

Projects

100 |
101 |
102 |
103 |
104 |

Certifications

105 |
106 |
107 |
108 |
109 |

Experience

110 |
111 |
112 |
113 |
114 |

Skills

115 |
116 |
117 |
118 |
119 |

Volunteer Experience

120 |
121 |
122 |
123 |
124 |

Accomplishments

125 |
126 |
127 |
128 |
129 |

Hobbies

130 |
131 |
132 |
133 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /formflask.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, request, send_from_directory 2 | import linkedin_scraper 3 | import json 4 | import os 5 | import output 6 | 7 | app = Flask(__name__) 8 | link="" 9 | 10 | ##to clear cache 11 | def dir_last_updated(folder): 12 | return str(max(os.path.getmtime(os.path.join(root_path, f)) 13 | for root_path, dirs, files in os.walk(folder) 14 | for f in files)) 15 | 16 | #homepage 17 | @app.route("/", methods=['POST','GET']) 18 | def home(): 19 | return render_template("homepage.html",last_updated=dir_last_updated('static')) 20 | 21 | #formpage 22 | @app.route("/form", methods=['POST','GET']) 23 | def form(): 24 | if request.method=='POST': 25 | #print("yes") 26 | link = request.form['profilelink'] 27 | #print(link) 28 | json_string1 = linkedin_scraper.linkedin_scraper1(link) 29 | #with app.open_resource('static/scraped_data.json') as f: 30 | #json_string1 = json.load(f) 31 | #print (json_string1) 32 | return render_template("formhtml.html",json_string=json_string1,last_updated=dir_last_updated('static')) 33 | 34 | #thankyoupage 35 | @app.route('/handle_data', methods=['POST']) 36 | def handle_data(): 37 | #get all the hidden data 38 | hidden_basic = request.form['hidden_basic1'] 39 | hidden_education = request.form['hidden_education1'] 40 | hidden_projects = request.form['hidden_projects1'] 41 | hidden_certifications = request.form['hidden_certifications1'] 42 | hidden_experience = request.form['hidden_experience1'] 43 | hidden_skils = request.form['hidden_skils1'] 44 | hidden_volunteer = request.form['hidden_volunteer1'] 45 | hidden_accomplishments = request.form['hidden_accomplishments1'] 46 | hidden_hobbies = request.form['hidden_hobbies1'] 47 | 48 | #get basic_info_list data 49 | basic_info_list=[0]*8 50 | basic_info_list_name=["fname","lname","headline","linkedin","email","phone","age","github"] 51 | for i in range(0,8): 52 | basic_info_list[i]=request.form[basic_info_list_name[i]] 53 | #print(basic_info_list) 54 | #get education_info_list data 55 | education_info_list_name=["institute","degree","year","grade"] 56 | education_info_list=[[0]*4 for i in range(int(hidden_education))] #[[0,0][0,0], [0,0]] 57 | for i in range(0,int(hidden_education)): 58 | education_info_list[i][0]=request.form[education_info_list_name[0]+str(i+1)] 59 | education_info_list[i][1]=request.form[education_info_list_name[1]+str(i+1)] 60 | education_info_list[i][2]=request.form[education_info_list_name[2]+str(i+1)] 61 | education_info_list[i][3]=request.form[education_info_list_name[3]+str(i+1)] 62 | #print(education_info_list) 63 | #get projects_info_list data 64 | projects_info_list_name=["projectname","projectduration","projectdescription"] 65 | projects_info_list=[[0]*3 for i in range(int(hidden_projects))] 66 | for i in range(0,int(hidden_projects)): 67 | projects_info_list[i][0]=request.form[projects_info_list_name[0]+str(i+1)] 68 | projects_info_list[i][1]=request.form[projects_info_list_name[1]+str(i+1)] 69 | projects_info_list[i][2]=request.form[projects_info_list_name[2]+str(i+1)] 70 | #print(projects_info_list) 71 | #get certifications_info_list data 72 | certifications_info_list_name=["certificationname","certificationdate","certificationorgan"] 73 | certifications_info_list=[[0]*3 for i in range(int(hidden_certifications))] 74 | for i in range(0,int(hidden_certifications)): 75 | certifications_info_list[i][0]=request.form[certifications_info_list_name[0]+str(i+1)] 76 | certifications_info_list[i][1]=request.form[certifications_info_list_name[1]+str(i+1)] 77 | certifications_info_list[i][2]=request.form[certifications_info_list_name[2]+str(i+1)] 78 | #print(certifications_info_list) 79 | #get experience_info_list data 80 | experience_info_list_name=["expname","exprole","expdate","expdescription"] 81 | experience_info_list=[[0]*4 for i in range(int(hidden_experience))] 82 | for i in range(0,int(hidden_experience)): 83 | experience_info_list[i][0]=request.form[experience_info_list_name[0]+str(i+1)] 84 | experience_info_list[i][1]=request.form[experience_info_list_name[1]+str(i+1)] 85 | experience_info_list[i][2]=request.form[experience_info_list_name[2]+str(i+1)] 86 | experience_info_list[i][3]=request.form[experience_info_list_name[3]+str(i+1)] 87 | #print(experience_info_list) 88 | #get skills_info_list_name data 89 | skills_info_list=[0]*int(hidden_skils) 90 | skills_info_list_name=["skill"] 91 | for i in range(0,int(hidden_skils)): 92 | skills_info_list[i]=request.form[skills_info_list_name[0]+str(i+1)] 93 | #print(skills_info_list) 94 | #get volunteer_info_list data 95 | volunteer_info_list_name=["voname","vorole","vodate","vodescription"] 96 | volunteer_info_list=[[0]*4 for i in range(int(hidden_volunteer))] 97 | for i in range(0,int(hidden_volunteer)): 98 | volunteer_info_list[i][0]=request.form[volunteer_info_list_name[0]+str(i+1)] 99 | volunteer_info_list[i][1]=request.form[volunteer_info_list_name[1]+str(i+1)] 100 | volunteer_info_list[i][2]=request.form[volunteer_info_list_name[2]+str(i+1)] 101 | volunteer_info_list[i][3]=request.form[volunteer_info_list_name[3]+str(i+1)] 102 | #print(volunteer_info_list) 103 | #get accomplishments_info_list data 104 | accomplishments_info_list_name=["accname","accyear"] 105 | accomplishments_info_list=[[0]*2 for i in range(int(hidden_accomplishments))] 106 | for i in range(0,int(hidden_accomplishments)): 107 | accomplishments_info_list[i][0]=request.form[accomplishments_info_list_name[0]+str(i+1)] 108 | accomplishments_info_list[i][1]=request.form[accomplishments_info_list_name[1]+str(i+1)] 109 | #print(accomplishments_info_list) 110 | #get skills_info_list_name data 111 | hobbies_info_list=[0]*int(hidden_hobbies) 112 | hobbies_info_list_name=["hobby"] 113 | for i in range(0,int(hidden_hobbies)): 114 | hobbies_info_list[i]=request.form[hobbies_info_list_name[0]+str(i+1)] 115 | #print(hobbies_info_list) 116 | #print(hidden_hobbies) 117 | json_data = {'basic_info_list' : basic_info_list, 'education_info_list': education_info_list, 'projects_info_list': projects_info_list, 'certifications_info_list': certifications_info_list, 'experience_info_list': experience_info_list, 'skills_info_list': skills_info_list, 'volunteer_info_list': volunteer_info_list, 'accomplishments_info_list': accomplishments_info_list, 'hobbies_info_list': hobbies_info_list} 118 | final_json_string = json.dumps(json_data) 119 | #print(final_json_string) 120 | output.output1(final_json_string) 121 | #file = get_pdf() 122 | #print(file) 123 | filename = "output.pdf" 124 | return send_from_directory("C:/Users/shrut/OneDrive/Desktop/Resume Scraper/yourapp", filename=filename, as_attachment=True) 125 | #return render_template("thankyou.html",last_updated=dir_last_updated('static')) 126 | 127 | 128 | 129 | if __name__ == "__main__": 130 | app.run(debug=True) 131 | -------------------------------------------------------------------------------- /static/style.css: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------*/ 2 | /* BASIC SETUP */ 3 | /*-------------------------------------------------*/ 4 | 5 | 6 | * { 7 | margin: 0; 8 | padding: 0; 9 | box-sizing: border-box; 10 | box-sizing: inherit; 11 | 12 | } 13 | 14 | html,body{ 15 | background-color: rgb(0, 0, 0); 16 | color: #000000; 17 | font-family: 'Lato', 'Arial', sans-serif; 18 | font-weight: 300; 19 | font-size: 20px; 20 | text-rendering: optimizeLegibility; 21 | overflow-x: hidden; 22 | margin:0; 23 | box-sizing: border-box; 24 | } 25 | 26 | /*-------------------------------------------------*/ 27 | /* HEADER */ 28 | /*-------------------------------------------------*/ 29 | header{ 30 | background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(bg.jpeg); 31 | background-size: cover; 32 | background-position: center; 33 | height: 100vh; 34 | } 35 | .hero-text-box{ 36 | position: absolute; 37 | width: 1140px; 38 | top: 50%; 39 | left: 47%; 40 | transform: translate(-50%, -50%); 41 | } 42 | 43 | .logo{ 44 | width: auto; 45 | height: 100px; 46 | float: left; 47 | margin-left: 50px; 48 | margin-top: 30px; 49 | filter: invert(100); 50 | } 51 | 52 | /* main nav */ 53 | .main-nav{ 54 | letter-spacing: 1px; 55 | float: right; 56 | list-style: none; 57 | margin-top: 50px; 58 | margin-right: 20px; 59 | } 60 | 61 | 62 | .main-nav li{ 63 | display: inline-block; 64 | margin-left: 40px; 65 | 66 | } 67 | .main-nav li a:link, 68 | .main-nav li a:visited{ 69 | padding: 8px 0; 70 | color: white ; 71 | text-decoration: none; 72 | text-transform: uppercase; 73 | font-size: 90%; 74 | 75 | transition: border-bottom 0.2s ; 76 | 77 | border: 1px solid transparent; 78 | margin-right: 15px; 79 | -webkit-transition: border-bottom 0.2s 80 | 81 | } 82 | 83 | .main-nav li a:hover, 84 | .main-nav li a:active{ 85 | border-bottom: 2px solid white; 86 | } 87 | 88 | 89 | 90 | .main-nav li:hover 91 | /*.main-nav li a:active*/{ 92 | border-bottom:2px solid rgb(14, 128, 235); 93 | background-color: rgb(14, 128, 235); 94 | border-radius: 10px; 95 | padding: 5px; 96 | } 97 | 98 | /*-----------------s--------------------------------*/ 99 | /* HEADINGS */ 100 | /*-------------------------------------------------*/ 101 | 102 | h1, 103 | h2, 104 | h3, 105 | h4{ 106 | 107 | font-weight: 300; 108 | text-transform: uppercase; 109 | font-size: 110%; 110 | margin-bottom: 15px; 111 | } 112 | 113 | 114 | h4{ 115 | 116 | font-size: 50px; 117 | margin-left: 400px; 118 | font-weight: 300; 119 | padding-top: 450px; 120 | color: #ffffff; 121 | } 122 | 123 | 124 | 125 | 126 | /*-------------------------------------------------*/ 127 | /* BUTTONS */ 128 | /*-------------------------------------------------*/ 129 | .btn:link, 130 | .btn:visited { 131 | display: inline-block; 132 | padding: 10px 30px; 133 | font-weight: 300; 134 | text-decoration: none; 135 | border-radius: 200px; 136 | color: white; 137 | transition: background-color 0.2s, border 0.2s, color 0.2s; 138 | } 139 | 140 | 141 | 142 | 143 | .btn-ghost:link, 144 | .btn-ghost:visited { 145 | margin-left: 150px; 146 | border: 1px solid rgb(14, 128, 235); 147 | font-weight:300; 148 | } 149 | 150 | .btn:hover, 151 | .btn:active{ 152 | background-color: rgb(14, 128, 235); 153 | } 154 | 155 | 156 | .btn-ghost:hover, 157 | .btn-ghost:active { 158 | border: 1px solid rgb(14, 128, 235); 159 | r-spacing: 1px; 160 | 161 | } 162 | 163 | h1{ 164 | margin-top: 0; 165 | margin-bottom: 20px; 166 | color: #fff; 167 | font-size: 240%; 168 | word-spacing: 4px; 169 | } 170 | 171 | h2{ 172 | font-size: 180%; 173 | word-spacing: 2px; 174 | text-align: center; 175 | margin-bottom: 15px; 176 | color: #ffffff; 177 | } 178 | h2:after { 179 | display: block; 180 | height: 2px; 181 | background: rgb(255, 255, 255); 182 | content: " "; 183 | width: 100px; 184 | margin: 0 auto; 185 | margin-top: 15px; 186 | } 187 | 188 | 189 | 190 | 191 | 192 | 193 | /*-------------------------------------------------*/ 194 | /* sign up*/ 195 | /*-------------------------------------------------*/ 196 | 197 | 198 | .modal { 199 | display: none; 200 | position: fixed; 201 | z-index: 1; 202 | left: 0; 203 | top: 0; 204 | width: 100%; 205 | height: 100%; 206 | overflow: auto; 207 | background-color: rgb(0, 0, 0); 208 | background-color: rgba(0, 0, 0, 0.4); 209 | padding-top: 60px; 210 | 211 | 212 | } 213 | 214 | 215 | .modal-content { 216 | background-color: #fefefe; 217 | margin: 5% auto 15% auto; 218 | border: 1px solid #888; 219 | border-radius: 15px; 220 | background-color: darkcyan; 221 | width: 30%; 222 | height: 24%; 223 | color: black; 224 | } 225 | 226 | .hand{font-family: "Montserrat", sans-serif; 227 | color:black; 228 | margin-bottom: 10px; 229 | } 230 | 231 | 232 | .cont { 233 | padding: 5px; 234 | } 235 | input[type=text], 236 | input[type=password] { 237 | font-size: 16px; 238 | width: 90%; 239 | padding: 10px 20px; 240 | margin-top: 8px ; 241 | margin-bottom: 15px; 242 | display: inline-block; 243 | border: 1px solid #ccc; 244 | box-sizing: border-box; 245 | 246 | } 247 | 248 | .hand{font-family: "Montserrat", sans-serif; 249 | color:#000000; 250 | } 251 | 252 | 253 | 254 | /*set a style for the buttons*/ 255 | button { 256 | background-color: rgb(14, 128, 235); 257 | color: white; 258 | padding: 15px 18px; 259 | margin-left: 0px; 260 | border-radius: 15px; 261 | border: none; 262 | cursor: pointer; 263 | width: 25%; 264 | } 265 | 266 | /* set a hover effect for the button*/ 267 | button:hover { 268 | opacity: 0.5; 269 | } 270 | 271 | /*set extra style for the cancel button*/ 272 | .cancelbtn { 273 | width: auto; 274 | padding: 5px 18px; 275 | background-color: rgb(14, 128, 235); 276 | float: right; 277 | } 278 | 279 | 280 | 281 | /*set padding to the container*/ 282 | .cont { 283 | padding: 5px; 284 | } 285 | 286 | /*set the forgot password text*/ 287 | span.psw { 288 | float:right; 289 | padding-top: 10px; 290 | } 291 | 292 | /*set the Modal background*/ 293 | .modal { 294 | display: none; 295 | position: fixed; 296 | z-index: 1; 297 | left: 0; 298 | top: 0; 299 | width: 100%; 300 | height: 100%; 301 | overflow: auto; 302 | background-color: rgb(0, 0, 0); 303 | background-color: rgba(0, 0, 0, 0.4); 304 | padding-top: 60px; 305 | text-align: center; 306 | 307 | } 308 | 309 | /*style the model content box*/ 310 | .modal-content { 311 | background-color: aliceblue; 312 | margin: 5% auto 15% auto; 313 | border: 1px solid #888 ; 314 | width: 37%; 315 | height: 35%; 316 | padding-top: 10px; 317 | } 318 | .modal-content1 { 319 | background-color: #f1f1f1; 320 | margin: 5% auto 15% auto; 321 | border: 1px solid #888 ; 322 | width: 35%; 323 | height: 90%; 324 | padding-top: 10px; 325 | } 326 | 327 | /*style the close button*/ 328 | .close { 329 | position: absolute; 330 | right: 25px; 331 | top: 0; 332 | color: #0000; 333 | font-size: 35px; 334 | font-weight: bold; 335 | float: right; 336 | } 337 | 338 | *:before, *:after { 339 | box-sizing: inherit; 340 | } 341 | 342 | .column { 343 | float: left; 344 | width: 33.3%; 345 | margin-bottom: 16px; 346 | padding: 0 8px; 347 | } 348 | 349 | .card { 350 | box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); 351 | margin: 8px; 352 | } 353 | 354 | .container { 355 | padding: 0 16px; 356 | } 357 | 358 | .container::after, .row::after { 359 | content: ""; 360 | clear: both; 361 | display: table; 362 | } 363 | 364 | .title { 365 | color: rgb(255, 255, 255); 366 | } 367 | 368 | .url{ 369 | border-radius: 5px; 370 | margin-bottom: 10px; 371 | } 372 | 373 | 374 | 375 | @media screen and (max-width: 650px) { 376 | .column { 377 | width: 100%; 378 | display: block; 379 | } 380 | } 381 | 382 | 383 | 384 | -------------------------------------------------------------------------------- /output.py: -------------------------------------------------------------------------------- 1 | from docx import Document 2 | from docx.shared import Inches 3 | from docx.shared import Pt 4 | from docx.shared import RGBColor 5 | from docx.enum.style import WD_STYLE_TYPE 6 | from docx.enum.table import WD_TABLE_ALIGNMENT 7 | from docx.oxml import OxmlElement 8 | from docx.oxml.ns import qn 9 | from docx.oxml.ns import nsdecls 10 | from docx.oxml import parse_xml 11 | from docx.enum.text import WD_COLOR_INDEX 12 | #from docx.enum.text import WD_ALIGN_PARAGRAPH 13 | from docx2pdf import convert 14 | import json 15 | 16 | def output1(file_data): 17 | #file_header = open("scraped_data.json", 'r') 18 | 19 | #file_data = file_header.read() 20 | json_data = json.loads(file_data) 21 | 22 | basic_info_list = json_data['basic_info_list'] 23 | education_info_list = json_data['education_info_list'] 24 | projects_info_list = json_data['projects_info_list'] 25 | certifications_info_list = json_data['certifications_info_list'] 26 | experience_info_list = json_data['experience_info_list'] 27 | skills_info_list = json_data['skills_info_list'] 28 | volunteer_info_list = json_data['volunteer_info_list'] 29 | accomplishments_info_list = json_data['accomplishments_info_list'] 30 | hobbies_info_list = json_data['hobbies_info_list'] 31 | 32 | #print("LISTS") 33 | #print(basic_info_list) 34 | #print(education_info_list) 35 | #print(projects_info_list) 36 | #print(certifications_info_list) 37 | #print(experience_info_list) 38 | #print(skills_info_list) 39 | #print(volunteer_info_list) 40 | #print(accomplishments_info_list) 41 | #ALL LISTS 42 | 43 | 44 | document = Document('input1.docx') 45 | section = document.sections[0] 46 | 47 | #Styles 48 | ##NameStyle 49 | style_name = document.styles['Normal'] 50 | font_name = style_name.font 51 | font_name.size = Pt(14) 52 | font_name.name = 'Times New Roman' 53 | style_name.paragraph_format.space_after = Pt(2) 54 | font_name.bold=True 55 | ##HeadlineStyle 56 | styles=document.styles 57 | #style_headline = styles.add_style('headLine1', WD_STYLE_TYPE.PARAGRAPH) 58 | style_headline = document.styles['headLine1'] 59 | paragraph_format_headline = style_headline.paragraph_format 60 | style_headline.paragraph_format.space_after = Pt(2) 61 | font_headline = style_headline.font 62 | font_headline.size = Pt(12) 63 | font_headline.name = 'Times New Roman' 64 | font_headline.bold=True 65 | ##EmailAndLinksStyle 66 | style_email = document.styles['No Spacing'] 67 | style_email.font.size = Pt(9) 68 | ##LineStyle 69 | style_line = document.styles['Line1'] 70 | paragraph_format_line = style_line.paragraph_format 71 | style_line.paragraph_format.space_after = Pt(2) 72 | font_line = style_line.font 73 | font_line.size = Pt(1) 74 | font_line.highlight_color = WD_COLOR_INDEX.BLACK 75 | font_line.bold=True 76 | #font_line.color.rgb = RGBColor(31, 73, 125) 77 | ##EmptySpaceStyle 78 | style_empty = document.styles['Subtitle'] 79 | font_empty = style_empty.font 80 | font_empty.size=Pt(1) 81 | 82 | 83 | 84 | #Function 85 | ##TABLEINDENTATION 86 | def indent_table(table, indent): 87 | # noinspection PyProtectedMember 88 | tbl_pr = table._element.xpath('w:tblPr') 89 | if tbl_pr: 90 | e = OxmlElement('w:tblInd') 91 | e.set(qn('w:w'), str(indent)) 92 | e.set(qn('w:type'), 'dxa') 93 | tbl_pr[0].append(e) 94 | ##TABLEWIDTH 95 | def ChangeWidthOfTable(table,width,column): 96 | for columnVarible in range(0,column): 97 | for cell in table.columns[columnVarible].cells: 98 | cell.width = Pt(width) 99 | ###ACADEMICSWIDTH 100 | def ChangeWidthOfTableAcademics(table,column): 101 | for columnVariable in range(0,column): 102 | if columnVariable==0: 103 | for cell in table.columns[columnVariable].cells: 104 | cell.width = Pt(240) 105 | elif columnVariable==1: 106 | for cell in table.columns[columnVariable].cells: 107 | cell.width = Pt(120) 108 | else: 109 | for cell in table.columns[columnVariable].cells: 110 | cell.width = Pt(60) 111 | ###PROJECTSWIDTH 112 | def ChangeWidthOfTableProjects(table,column): 113 | for columnVariable in range(0,column): 114 | if columnVariable==0: 115 | for cell in table.columns[columnVariable].cells: 116 | cell.width = Pt(370) 117 | elif columnVariable==1: 118 | for cell in table.columns[columnVariable].cells: 119 | cell.width = Pt(110) 120 | ###CERTIFICATIONSWIDTH 121 | def ChangeWidthOfTableCertifications(table,column): 122 | for columnVariable in range(0,column): 123 | if columnVariable==0: 124 | for cell in table.columns[columnVariable].cells: 125 | cell.width = Pt(400) 126 | elif columnVariable==1: 127 | for cell in table.columns[columnVariable].cells: 128 | cell.width = Pt(80) 129 | ##ALLSTYLES 130 | dstyles=document.styles 131 | def allstyles(dstyles): 132 | k = len(dstyles) 133 | #print (k) 134 | for i in dstyles: 135 | pass 136 | #print (i.name) ##to print all styles 137 | allstyles(dstyles) 138 | ##TABLESTYLE 139 | def tablesty(table): 140 | table.rows[0].cells[0]._tc.get_or_add_tcPr().append(parse_xml(r''.format(nsdecls('w')))) 141 | table.rows[0].cells[0].paragraphs[0].runs[0].font.size = Pt(9) 142 | table.rows[0].cells[0].paragraphs[0].runs[0].font.name = 'Tahoma' 143 | table.rows[0].cells[0].paragraphs[0].runs[0].font.bold=True 144 | ##ACADEMICSMAINTABLESTYLE 145 | def academics_maintablesty(table): 146 | i=0 147 | for rows in table.rows: 148 | for cells in rows.cells: 149 | cells.paragraphs[0].runs[0].font.size=Pt(10) 150 | if i==0: 151 | cells.paragraphs[0].runs[0].font.bold=True 152 | else: 153 | cells.paragraphs[0].runs[0].font.bold=False 154 | i+=1 155 | ##PROJECTMAINTABLESTYLE 156 | def projects_maintablesty(table): 157 | i=0 158 | for rows in table.rows: 159 | for cells in rows.cells: 160 | j=0 161 | if i%2==0: 162 | cells.paragraphs[0].runs[0].font.size=Pt(10) 163 | cells.paragraphs[0].runs[0].font.bold=True 164 | elif i%2!=0: 165 | if cells.text=="": 166 | pass 167 | else: 168 | cells.paragraphs[0].runs[0].font.size=Pt(10) 169 | cells.paragraphs[0].runs[0].font.bold=False 170 | j+=1 171 | i+=1 172 | ##ACCOMPLISHMENTSMAINTABLESTYLE 173 | def accomplishments_maintablesty(table): 174 | i=0 175 | for rows in table.rows: 176 | for cells in rows.cells: 177 | j=0 178 | if i==0: 179 | cells.paragraphs[0].runs[0].font.size=Pt(10) 180 | cells.paragraphs[0].runs[0].font.bold=True 181 | else: 182 | cells.paragraphs[0].runs[0].font.size=Pt(10) 183 | cells.paragraphs[0].runs[0].font.bold=False 184 | j+=1 185 | i+=1 186 | ##CERTIFICATIONSMAINTABLESTYLE 187 | def certifications_maintablesty(table): 188 | i=0 189 | for rows in table.rows: 190 | for cells in rows.cells: 191 | cells.paragraphs[0].runs[0].font.size=Pt(10) 192 | cells.paragraphs[0].runs[0].font.bold=False 193 | i+=1 194 | 195 | #HEADER 196 | header = section.header 197 | 198 | sections = document.sections 199 | ##NAME 200 | name = header.paragraphs[0] 201 | name.text = (basic_info_list[0].upper()," ",basic_info_list[1].upper()) 202 | name.paragraph_format.first_line_indent = Pt(-50) 203 | name.style = document.styles['Normal'] 204 | ##HEADLINE 205 | if basic_info_list[2]=='': 206 | pass 207 | else : 208 | headLine = header.add_paragraph(basic_info_list[2]) 209 | headLine.paragraph_format.first_line_indent = Pt(-50) 210 | headLine.style = document.styles['headLine1'] 211 | ##EMAIL 212 | flag=0 213 | if basic_info_list[4]=='' and basic_info_list[5]=='' and basic_info_list[6]=='': 214 | flag=1 215 | if basic_info_list[4]=='' : 216 | str1="" 217 | else: 218 | str1=basic_info_list[4]+" | " 219 | if basic_info_list[5]=='' : 220 | str2="" 221 | else: 222 | str2=basic_info_list[5]+" | " 223 | if basic_info_list[6]=='': 224 | str3="" 225 | else: 226 | str3="Age : "+basic_info_list[6] 227 | if flag==1: 228 | pass 229 | else: 230 | email = header.add_paragraph(str1+str2+str3) 231 | email.paragraph_format.first_line_indent = Pt(-50) 232 | email.style = document.styles['No Spacing'] 233 | ##LINKEDIN 234 | flag=0 235 | if basic_info_list[3]=="" and basic_info_list[7]=="": 236 | flag=1 237 | if basic_info_list[3]=="": 238 | str1="" 239 | else: 240 | str1="LinkedIn - "+basic_info_list[3]+" | " 241 | if basic_info_list[7]=="": 242 | str2="" 243 | else: 244 | str2="GitHub - "+basic_info_list[7] 245 | if flag==1: 246 | pass 247 | else: 248 | linkedin = header.add_paragraph(str1+" "+str2) 249 | linkedin.paragraph_format.first_line_indent = Pt(-50) 250 | linkedin.style = document.styles['No Spacing'] 251 | 252 | #LINE 253 | line = document.add_paragraph("_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________") 254 | line.style=document.styles['Line1'] 255 | line.paragraph_format.first_line_indent = Pt(-50) 256 | #EMPTYSPACE 257 | es1 = document.add_paragraph() 258 | es1.paragraph_format.first_line_indent = Pt(-50) 259 | es1.style = document.styles['Subtitle'] 260 | #TABLE 261 | ##ACADEMICS 262 | if len(education_info_list)==0: 263 | pass 264 | else: 265 | #ACADEMICSHEADER 266 | tabler = document.add_table(rows=1,cols=1) 267 | tabler.rows[0].cells[0].text="ACADEMICS" 268 | tabler.style = document.styles['Light List'] 269 | indent_table(tabler,-900) 270 | ChangeWidthOfTable(tabler,480,1) 271 | tablesty(tabler) 272 | ##EMPTYSPACE 273 | es2 = document.add_paragraph() 274 | es2.paragraph_format.first_line_indent = Pt(-50) 275 | es2.style = document.styles['Subtitle'] 276 | ##ACADEMICSTABLE 277 | row_num = len(education_info_list) 278 | tablerr = document.add_table(rows=row_num+1,cols=4) 279 | indent_table(tablerr,-900) 280 | ChangeWidthOfTableAcademics(tablerr,4) 281 | tablerr.style = document.styles['Main Table'] 282 | tablerr.rows[0].cells[0].text="Institute" 283 | tablerr.rows[0].cells[1].text="Board / University" 284 | tablerr.rows[0].cells[2].text="Year" 285 | tablerr.rows[0].cells[3].text="% / CGPA" 286 | for i in range (1,len(tablerr.rows)): 287 | j=0 288 | for cells in tablerr.rows[i].cells: 289 | s = education_info_list[i-1] 290 | s1 = s[j] 291 | cells.text=s1 292 | j+=1 293 | academics_maintablesty(tablerr) 294 | ##EMPTYSPACE 295 | es3 = document.add_paragraph() 296 | es3.paragraph_format.first_line_indent = Pt(-50) 297 | es3.style = document.styles['Subtitle'] 298 | ##PROJECTS 299 | if len(projects_info_list)==0: 300 | pass 301 | else: 302 | ##PROJECTSHEADER 303 | table_project_header = document.add_table(rows=1,cols=1) 304 | table_project_header.rows[0].cells[0].text="PROJECTS" 305 | table_project_header.style = document.styles['Light List'] 306 | indent_table(table_project_header,-900) 307 | ChangeWidthOfTable(table_project_header,480,1) 308 | tablesty(table_project_header) 309 | ##EMPTYSPACE 310 | es4 = document.add_paragraph() 311 | es4.paragraph_format.first_line_indent = Pt(-50) 312 | es4.style = document.styles['Subtitle'] 313 | ##PROJECTSTABLE 314 | row_num = len(projects_info_list) 315 | table_project = document.add_table(rows=(row_num)*2,cols=2) 316 | indent_table(table_project,-900) 317 | ChangeWidthOfTableProjects(table_project,2) 318 | table_project.style = document.styles['Main Project Table'] 319 | for i in range (0,len(table_project.rows)): 320 | j=0 321 | for cells in table_project.rows[i].cells: 322 | if i%2==0 and j==0: 323 | s = projects_info_list[(int)(i/2)] 324 | s1 = "• "+s[j] 325 | cells.text=s1 326 | elif i%2==0 and j==1: 327 | s = projects_info_list[(int)(i/2)] 328 | s1 = s[j] 329 | cells.text=s1 330 | elif i%2!=0 and j==0 : 331 | s=projects_info_list[(int)(i/2)] 332 | s1 = s[2] 333 | cells.text=s1 334 | elif i%2!=0 and j==1 : 335 | cells.text='' 336 | j+=1 337 | projects_maintablesty(table_project) 338 | ##EMPTYSPACE 339 | es4 = document.add_paragraph() 340 | es4.paragraph_format.first_line_indent = Pt(-50) 341 | es4.style = document.styles['Subtitle'] 342 | ##CERTIFICATIONS 343 | if len(certifications_info_list)==0: 344 | pass 345 | else: 346 | ##CERTIFICATIONSTSHEADER 347 | table_certifications_header = document.add_table(rows=1,cols=1) 348 | table_certifications_header.rows[0].cells[0].text="CERTIFICATIONS" 349 | table_certifications_header.style = document.styles['Light List'] 350 | indent_table(table_certifications_header,-900) 351 | ChangeWidthOfTable(table_certifications_header,480,1) 352 | tablesty(table_certifications_header) 353 | ##EMPTYSPACE 354 | es5 = document.add_paragraph() 355 | es5.paragraph_format.first_line_indent = Pt(-50) 356 | es5.style = document.styles['Subtitle'] 357 | ##CERTIFICATIONSTABLE 358 | row_num = len(certifications_info_list) 359 | table_certifications = document.add_table(rows=(row_num),cols=2) 360 | indent_table(table_certifications,-900) 361 | ChangeWidthOfTableCertifications(table_certifications,2) 362 | table_certifications.style = document.styles['Main Project Table'] 363 | for i in range (0,len(table_certifications.rows)): 364 | j=0 365 | for cells in table_certifications.rows[i].cells: 366 | s = certifications_info_list[i] 367 | if j==0: 368 | s1 = "• "+s[j]+" Issued by "+s[2] 369 | else : 370 | s1 = s[j] 371 | cells.text=s1 372 | j+=1 373 | certifications_maintablesty(table_certifications) 374 | ##EMPTYSPACE 375 | es6 = document.add_paragraph() 376 | es6.paragraph_format.first_line_indent = Pt(-50) 377 | es6.style = document.styles['Subtitle'] 378 | ##SKILLS 379 | if len(skills_info_list)==0: 380 | pass 381 | else: 382 | ##CERTIFICATIONSTSHEADER 383 | table_skills_header = document.add_table(rows=1,cols=1) 384 | table_skills_header.rows[0].cells[0].text="TECHNICAL SKILLS" 385 | table_skills_header.style = document.styles['Light List'] 386 | indent_table(table_skills_header,-900) 387 | ChangeWidthOfTable(table_skills_header,480,1) 388 | tablesty(table_skills_header) 389 | ##EMPTYSPACE 390 | es7 = document.add_paragraph() 391 | es7.paragraph_format.first_line_indent = Pt(-50) 392 | es7.style = document.styles['Subtitle'] 393 | ##SKILLSTABLE 394 | table_skills = document.add_table(rows=1,cols=1) 395 | indent_table(table_skills,-900) 396 | ChangeWidthOfTable(table_skills,480,1) 397 | table_skills.style = document.styles['Main Project Table'] 398 | for i in range (0,len(table_skills.rows)): 399 | len1 = len(skills_info_list) 400 | s1="" 401 | for len1 in range (0, len1-1): 402 | s1+=skills_info_list[len1]+", " 403 | s1+=skills_info_list[len1+1] 404 | table_skills.rows[0].cells[0].text=s1 405 | certifications_maintablesty(table_skills) 406 | ##EMPTYSPACE 407 | es8 = document.add_paragraph() 408 | es8.paragraph_format.first_line_indent = Pt(-50) 409 | es8.style = document.styles['Subtitle'] 410 | ##EXPERIENCE 411 | if len(experience_info_list)==0: 412 | pass 413 | else: 414 | ##EXPERIENCEHEADER 415 | table_experience_header = document.add_table(rows=1,cols=1) 416 | table_experience_header.rows[0].cells[0].text="WORK EXPERIENCE" 417 | table_experience_header.style = document.styles['Light List'] 418 | indent_table(table_experience_header,-900) 419 | ChangeWidthOfTable(table_experience_header,480,1) 420 | tablesty(table_experience_header) 421 | ##EMPTYSPACE 422 | es9 = document.add_paragraph() 423 | es9.paragraph_format.first_line_indent = Pt(-50) 424 | es9.style = document.styles['Subtitle'] 425 | ##EXPERIENCETABLE 426 | row_num = len(experience_info_list) 427 | table_experience = document.add_table(rows=(row_num)*2,cols=2) 428 | indent_table(table_experience,-900) 429 | ChangeWidthOfTableProjects(table_experience,2) 430 | table_experience.style = document.styles['Main Project Table'] 431 | for i in range (0,len(table_experience.rows)): 432 | j=0 433 | for cells in table_experience.rows[i].cells: 434 | if i%2==0 and j==0: 435 | s = experience_info_list[(int)(i/2)] 436 | s1 = "• "+s[1]+" at "+s[0] 437 | cells.text=s1 438 | elif i%2==0 and j==1: 439 | s = experience_info_list[(int)(i/2)] 440 | s1 = s[2] 441 | cells.text=s1 442 | elif i%2!=0 and j==0 : 443 | s = experience_info_list[(int)(i/2)] 444 | s1 = s[3] 445 | cells.text=s1 446 | elif i%2!=0 and j==1 : 447 | cells.text='' 448 | j+=1 449 | projects_maintablesty(table_experience) 450 | ##EMPTYSPACE 451 | es10 = document.add_paragraph() 452 | es10.paragraph_format.first_line_indent = Pt(-50) 453 | es10.style = document.styles['Subtitle'] 454 | ##VOLUNTEER 455 | if len(volunteer_info_list)==0: 456 | pass 457 | else: 458 | ##EXPERIENCEHEADER 459 | table_volunteer_header = document.add_table(rows=1,cols=1) 460 | table_volunteer_header.rows[0].cells[0].text="VOLUNTEER EXPERIENCE" 461 | table_volunteer_header.style = document.styles['Light List'] 462 | indent_table(table_volunteer_header,-900) 463 | ChangeWidthOfTable(table_volunteer_header,480,1) 464 | tablesty(table_volunteer_header) 465 | ##EMPTYSPACE 466 | es11 = document.add_paragraph() 467 | es11.paragraph_format.first_line_indent = Pt(-50) 468 | es11.style = document.styles['Subtitle'] 469 | ##EXPERIENCETABLE 470 | row_num = len(volunteer_info_list) 471 | table_vexperience = document.add_table(rows=(row_num)*2,cols=2) 472 | indent_table(table_vexperience,-900) 473 | ChangeWidthOfTableProjects(table_vexperience,2) 474 | table_vexperience.style = document.styles['Main Project Table'] 475 | for i in range (0,len(table_vexperience.rows)): 476 | j=0 477 | for cells in table_vexperience.rows[i].cells: 478 | if i%2==0 and j==0: 479 | s = volunteer_info_list[(int)(i/2)] 480 | s1 = "• "+s[1]+" at "+s[0] 481 | cells.text=s1 482 | elif i%2==0 and j==1: 483 | s = volunteer_info_list[(int)(i/2)] 484 | s1 = s[2] 485 | cells.text=s1 486 | elif i%2!=0 and j==0 : 487 | s = volunteer_info_list[(int)(i/2)] 488 | s1 = s[3] 489 | cells.text=s1 490 | elif i%2!=0 and j==1 : 491 | cells.text='' 492 | j+=1 493 | projects_maintablesty(table_vexperience) 494 | ##EMPTYSPACE 495 | es12 = document.add_paragraph() 496 | es12.paragraph_format.first_line_indent = Pt(-50) 497 | es12.style = document.styles['Subtitle'] 498 | ##COCURRICULAR 499 | if len(accomplishments_info_list)==0: 500 | pass 501 | else: 502 | ##ACCOMPLISHMENTSHEADER 503 | table_cocurricular_header = document.add_table(rows=1,cols=1) 504 | table_cocurricular_header.rows[0].cells[0].text="ACCOMPLISHMENTS" 505 | table_cocurricular_header.style = document.styles['Light List'] 506 | indent_table(table_cocurricular_header,-900) 507 | ChangeWidthOfTable(table_cocurricular_header,480,1) 508 | tablesty(table_cocurricular_header) 509 | ##EMPTYSPACE 510 | es13 = document.add_paragraph() 511 | es13.paragraph_format.first_line_indent = Pt(-50) 512 | es13.style = document.styles['Subtitle'] 513 | ##COCURRICULARTABLE 514 | if len(accomplishments_info_list)!=0: 515 | ##ACCOMPLISHMENTSTABLE 516 | row_num = len(accomplishments_info_list) 517 | table_accomplishments = document.add_table(rows=(row_num),cols=2) 518 | indent_table(table_accomplishments,-900) 519 | ChangeWidthOfTableCertifications(table_accomplishments,2) 520 | table_accomplishments.style = document.styles['Main Project Table'] 521 | for i in range (0,row_num): 522 | j=0 523 | for cells in table_accomplishments.rows[i].cells: 524 | if j==0: 525 | s = accomplishments_info_list[(int)(i)] 526 | s1 = "• "+s[0] 527 | cells.text=s1 528 | elif j==1: 529 | s = accomplishments_info_list[(int)(i)] 530 | s1 = s[1] 531 | cells.text=s1 532 | j+=1 533 | certifications_maintablesty(table_accomplishments) 534 | ##EMPTYSPACE 535 | es14 = document.add_paragraph() 536 | es14.paragraph_format.first_line_indent = Pt(-50) 537 | es14.style = document.styles['Subtitle'] 538 | 539 | ##HOBBIES 540 | if len(hobbies_info_list)==0: 541 | pass 542 | else: 543 | ##ACCOMPLISHMENTSHEADER 544 | table_hobbies_header = document.add_table(rows=1,cols=1) 545 | table_hobbies_header.rows[0].cells[0].text="HOBBIES" 546 | table_hobbies_header.style = document.styles['Light List'] 547 | indent_table(table_hobbies_header,-900) 548 | ChangeWidthOfTable(table_hobbies_header,480,1) 549 | tablesty(table_hobbies_header) 550 | ##EMPTYSPACE 551 | es16 = document.add_paragraph() 552 | es16.paragraph_format.first_line_indent = Pt(-50) 553 | es16.style = document.styles['Subtitle'] 554 | if len(hobbies_info_list)!=0: 555 | ##HOBBIESTABLE 556 | row_num = len(hobbies_info_list) 557 | table_hobbies = document.add_table(rows=(row_num),cols=1) 558 | indent_table(table_hobbies,-900) 559 | ChangeWidthOfTable(table_hobbies,480,1) 560 | table_hobbies.style = document.styles['Main Project Table'] 561 | for i in range (0,row_num): 562 | for cells in table_hobbies.rows[i].cells: 563 | s = "• "+hobbies_info_list[i] 564 | cells.text=s 565 | certifications_maintablesty(table_hobbies) 566 | ##EMPTYSPACE 567 | es17 = document.add_paragraph() 568 | es17.paragraph_format.first_line_indent = Pt(-50) 569 | es17.style = document.styles['Subtitle'] 570 | 571 | 572 | document.save('input.docx') 573 | convert("input.docx", "output.pdf") -------------------------------------------------------------------------------- /linkedin_scraper.py: -------------------------------------------------------------------------------- 1 | import time 2 | from bs4 import BeautifulSoup 3 | from selenium import webdriver 4 | from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 5 | import re 6 | import json 7 | 8 | 9 | def linkedin_scraper1(link): 10 | #Initialize Options to start Chrome as headless in selenium 11 | chrome_options = webdriver.ChromeOptions() 12 | chrome_options.add_argument("--headless") 13 | capabilities = DesiredCapabilities.CHROME.copy() 14 | capabilities['acceptSslCerts'] = True 15 | capabilities['acceptInsecureCerts'] = True 16 | 17 | #Initialize the chrome webdriver as 'browser' 18 | browser = webdriver.Chrome(options=chrome_options, desired_capabilities=capabilities) 19 | 20 | #To initialize the webdriver in a new window for Debugging: 21 | #browser = webdriver.Chrome('chromedriver.exe') 22 | 23 | #Get the login page for linkedin 24 | browser.get('https://www.linkedin.com/uas/login') 25 | 26 | #Open the file with the username and password for LinkedIn login 27 | file = open('config.txt') 28 | lines = file.readlines() 29 | username = lines[0] 30 | password = lines[1] 31 | 32 | #Username and Password for login 33 | elementID = browser.find_element_by_id('username') 34 | elementID.send_keys(username) 35 | 36 | elementID = browser.find_element_by_id('password') 37 | elementID.send_keys(password) 38 | 39 | elementID.submit() 40 | global time 41 | time.sleep(5) 42 | 43 | #Profile Link to be scraped 44 | #link = "https://www.linkedin.com/in/rishab-saini/" 45 | browser.get(link) 46 | 47 | #pause before scrolling 48 | SCROLL_PAUSE_TIME = 6 49 | 50 | #Get the scroll height of the page 51 | last_height = browser.execute_script("return document.body.scrollHeight") 52 | 53 | #scroll the entire page due to dynamic loading of the webpage we need to load the entire webpage by scrolling 54 | for i in range(3): 55 | # Scroll down to bottom 56 | browser.execute_script("window.scrollTo(0, document.body.scrollHeight/3);") 57 | time.sleep(SCROLL_PAUSE_TIME/2) 58 | browser.execute_script("window.scrollTo(0, document.body.scrollHeight*(2/3));") 59 | time.sleep(SCROLL_PAUSE_TIME/2) 60 | browser.execute_script("window.scrollTo(0, document.body.scrollHeight);") 61 | # Wait to load page 62 | time.sleep(SCROLL_PAUSE_TIME) 63 | 64 | # Calculate new scroll height and compare with last scroll height 65 | new_height = browser.execute_script("return document.body.scrollHeight") 66 | if new_height == last_height: 67 | break 68 | last_height = new_height 69 | 70 | #try to expand sections(if available), else pass 71 | try: 72 | #click to expand education section 73 | education_expand_button = browser.find_element_by_xpath("//section[@id='education-section']//button[@class='pv-profile-section__see-more-inline pv-profile-section__text-truncate-toggle link link-without-hover-state']") 74 | browser.execute_script("arguments[0].click();", education_expand_button) 75 | except Exception as e: 76 | #print("education_expand_button Exception:", e) 77 | pass 78 | 79 | try: 80 | #click to expand projects section 81 | projects_expand_button = browser.find_element_by_xpath("//div[@class='pv-accomplishments-block__content break-words']//button[@aria-label='Expand projects section' and @aria-expanded='false']") 82 | browser.execute_script("arguments[0].click();", projects_expand_button) 83 | except Exception as e: 84 | # print("projects_expand_button Exception:", e) 85 | pass 86 | 87 | try: 88 | #click to expand certifications section 89 | certifications_expand_button = browser.find_element_by_xpath("//button[@class='pv-profile-section__see-more-inline pv-profile-section__text-truncate-toggle link link-without-hover-state']") 90 | browser.execute_script("arguments[0].click();", certifications_expand_button) 91 | except Exception as e: 92 | # print("certifications_expand_button Exception:", e) 93 | pass 94 | 95 | try: 96 | # click to expand experience section 97 | experiences_expand_button = browser.find_element_by_xpath("//button[@class='pv-profile-section__see-more-inline pv-profile-section__text-truncate-toggle link link-without-hover-state']") 98 | browser.execute_script("arguments[0].click();", experiences_expand_button) 99 | 100 | time.sleep(2) 101 | 102 | #inline-show-more-text__button link 103 | experiences_show_more_expand_button = browser.find_element_by_xpath("//button[@class='inline-show-more-text__button link']") 104 | #print(experiences_show_more_expand_button) 105 | browser.execute_script("arguments[0].click();", experiences_show_more_expand_button) 106 | except Exception as e: 107 | # print("experiences_expand_button Exception:", e) 108 | pass 109 | 110 | try: 111 | # click to expand skills section 112 | skills_expand_button = browser.find_element_by_xpath("//button[@class='pv-profile-section__card-action-bar pv-skills-section__additional-skills artdeco-container-card-action-bar artdeco-button artdeco-button--tertiary artdeco-button--3 artdeco-button--fluid']") 113 | browser.execute_script("arguments[0].click();", skills_expand_button) 114 | except Exception as e: 115 | # print("skills_expand_button Exception:", e) 116 | pass 117 | 118 | try: 119 | # click to expand volunteering section 120 | volunteer_expand_button = browser.find_element_by_xpath("//button[@class='pv-profile-section__see-more-inline pv-profile-section__text-truncate-toggle link link-without-hover-state']") 121 | browser.execute_script("arguments[0].click();", volunteer_expand_button) 122 | except Exception as e: 123 | # print("volunteer_expand_button Exception:", e) 124 | pass 125 | 126 | #use beautiful soup for html parsing 127 | src = browser.page_source 128 | soup = BeautifulSoup(src, 'lxml') 129 | 130 | #BASIC INFO LIST 131 | basic_info_list = [] 132 | 133 | name_div = soup.find('div', {'class': 'flex-1 mr5'}) 134 | name_loc = name_div.find_all('ul') 135 | fullname = name_loc[0].find('li').get_text().strip() 136 | try: 137 | first_name, last_name = fullname.split() 138 | #above statement fails when a person has put their name as firstname, middlename, lastname 139 | except: 140 | first_name, middle_name, last_name = fullname.split() 141 | 142 | basic_info_list.append(first_name) 143 | basic_info_list.append(last_name) 144 | 145 | headline = name_div.find('h2').get_text().strip() 146 | basic_info_list.append(headline) 147 | basic_info_list.append(link) 148 | 149 | #appending empty strings for email_id, phone_number, age and github_link 150 | basic_info_list.append('') 151 | basic_info_list.append('') 152 | basic_info_list.append('') 153 | basic_info_list.append('') 154 | 155 | #print(basic_info_list) 156 | 157 | #education section 158 | education_info_list =[] 159 | try: 160 | edu_section = soup.find('section', {'id': 'education-section'}).find('ul') 161 | edu_section = edu_section.find_all('div', {'class': 'pv-entity__summary-info pv-entity__summary-info--background-section'}) 162 | college_names = [] 163 | degree_names = [] 164 | field_names = [] 165 | grades = [] 166 | dates = [] 167 | for x in range(len(edu_section)): 168 | curr_section = edu_section[x] 169 | try: 170 | college_name = curr_section.find('h3', {'class': 'pv-entity__school-name t-16 t-black t-bold'}) 171 | college_names.append(college_name.get_text()) 172 | except Exception as e: 173 | #print("Education college_name Exception",e) 174 | college_names.append('') 175 | 176 | try: 177 | degree_name = curr_section.find('p', {'class': 'pv-entity__secondary-title pv-entity__degree-name t-14 t-black t-normal'}).find('span', {'class': 'pv-entity__comma-item'}) 178 | degree_names.append(degree_name.get_text()) 179 | except Exception as e: 180 | #print("Education degree_name Exception",e) 181 | degree_names.append('') 182 | 183 | try: 184 | field_name = curr_section.find('p', {'class': 'pv-entity__secondary-title pv-entity__fos t-14 t-black t-normal'}).find('span', {'class': 'pv-entity__comma-item'}) 185 | field_names.append(field_name.get_text()) 186 | except Exception as e: 187 | #print("Education field_name Exception",e) 188 | field_names.append('') 189 | 190 | try: 191 | grade = curr_section.find('p', {'class': 'pv-entity__secondary-title pv-entity__grade t-14 t-black t-normal'}).find('span', {'class': 'pv-entity__comma-item'}) 192 | grades.append(grade.get_text()) 193 | except Exception as e: 194 | #print("Education grade Exception",e) 195 | grades.append('') 196 | 197 | try: 198 | time = curr_section.find('p', {'class': 'pv-entity__dates t-14 t-black--light t-normal'}) 199 | dates.append((time.find_all('time')[1].get_text())) 200 | except Exception as e: 201 | #print("Education time Exception",e) 202 | dates.append('') 203 | 204 | for i in range(len(edu_section)): 205 | education_info_list.append([college_names[i], degree_names[i], field_names[i], dates[i], grades[i]]) 206 | except Exception as e: 207 | #no education added 208 | #print("Education Section Exception", e) 209 | pass 210 | 211 | #print(education_info_list) 212 | 213 | 214 | #Project Section 215 | projects_info_list = [] 216 | project_titles = [] 217 | try: 218 | project_section = soup.find('div', {'id': 'projects-expandable-content'}) 219 | project_section = project_section.find('ul', {'class': 'pv-accomplishments-block__list'}) 220 | 221 | projects = project_section.find_all('h4', {'class': 'pv-accomplishment-entity__title t-14 t-bold'}) 222 | 223 | for i in range(len(projects)): 224 | project_name = projects[i].get_text().split('\n')[2] 225 | project_name = re.sub(' +', ' ', project_name) 226 | project_titles.append(project_name.strip()) 227 | 228 | 229 | projects = project_section.find_all('p', {'class': 'pv-accomplishment-entity__date t-14'}) 230 | project_time = [] 231 | for i in range(len(project_titles)): 232 | try: 233 | project_date = projects[i].get_text().split('\n')[1] 234 | project_date = re.sub(' +', ' ', project_date) 235 | project_time.append(project_date[1:]) 236 | except Exception as e: 237 | # print("project_date Exception", e) 238 | project_time.append('') 239 | 240 | project_descriptions = [] 241 | projects2 = project_section.find_all('p', {'class': 'pv-accomplishment-entity__description t-14'}) 242 | for i in range(len(project_titles)): 243 | try: 244 | next_empty_elem = projects2[i].findNext('div') 245 | curr_proj_desc = next_empty_elem.next_sibling 246 | project_descriptions.append(curr_proj_desc.strip()) 247 | except Exception as e: 248 | # print("curr_proj_desc Exception", e) 249 | project_descriptions.append('') 250 | 251 | #Construct projects_info_list from above data 252 | for i in range(len(project_titles)): 253 | projects_info_list.append([project_titles[i], project_time[i], project_descriptions[i]]) 254 | except Exception as e: 255 | #no projects added 256 | #print("Project Section Exception", e) 257 | pass 258 | #print(projects_info_list) 259 | 260 | #certifications section 261 | certifications_info_list = [] 262 | try: 263 | certificates_section = soup.find('section', {'id': 'certifications-section'}) 264 | 265 | list_items = certificates_section.find('ul', {'class': 'pv-profile-section__section-info section-info pv-profile-section__section-info--has-more'}) 266 | except Exception as e: 267 | #print("certificates_section Exception", e) 268 | pass 269 | try: 270 | if list_items is None: 271 | list_items = certificates_section.find('ul', {'class': 'pv-profile-section__section-info section-info pv-profile-section__section-info--has-no-more'}) 272 | 273 | items = list_items.find_all('li', {'class' : 'pv-profile-section__sortable-item pv-certification-entity ember-view'}) 274 | cert_names_list = [] 275 | cert_issuer_list = [] 276 | cert_dates_list = [] 277 | 278 | for i in range(len(items)): 279 | curr_cert_name = items[i].find('h3', {'class': 't-16 t-bold'}) 280 | curr_cert_name = curr_cert_name.get_text().strip() 281 | cert_names_list.append(curr_cert_name) 282 | 283 | curr_issuer_name = items[i].find_all('p', {'class': 't-14'})[0] 284 | curr_issuer_name = curr_issuer_name.get_text().strip() 285 | curr_issuer_name = curr_issuer_name.replace('Issuing authority\n', '') 286 | cert_issuer_list.append(curr_issuer_name) 287 | 288 | curr_cert_date = items[i].find_all('p', {'class': 't-14'})[1] 289 | curr_cert_date = curr_cert_date.get_text().strip() 290 | curr_cert_date = curr_cert_date.replace('Issued date and, if applicable, expiration date of the certification or license\n', '').replace('No Expiration Date', '').replace('Issued ', '') 291 | cert_dates_list.append(curr_cert_date) 292 | 293 | #adding elements in certifications_info_list as per schema 294 | for i in range(len(cert_names_list)): 295 | certifications_info_list.append([cert_names_list[i], cert_dates_list[i], cert_issuer_list[i]]) 296 | 297 | except Exception as e: 298 | #no certificates added 299 | #print("Certificates Section Exception", e) 300 | pass 301 | 302 | #print(certifications_info_list) 303 | 304 | #Experience Section 305 | experience_info_list = [] 306 | list_items = [] 307 | items = [] 308 | 309 | try: 310 | experience_section = soup.find('section', {'class': 'experience-section'}) 311 | #print(experience_section) 312 | 313 | list_items = experience_section.find('ul', {'class': 'pv-profile-section__section-info section-info pv-profile-section__section-info--has-more'}) 314 | except Exception as e: 315 | #print("experience_section Exception", e) 316 | pass 317 | 318 | try: 319 | if list_items is None: 320 | list_items = experience_section.find('ul', {'class': 'pv-profile-section__section-info section-info pv-profile-section__section-info--has-no-more'}) 321 | 322 | items = list_items.find_all('li', {'class' : 'pv-entity__position-group-pager pv-profile-section__list-item ember-view'}) 323 | company_names_list = [] 324 | position_list = [] 325 | dates_employed_list = [] 326 | description_list = [] 327 | 328 | for i in range(len(items)): 329 | try: 330 | curr_name = items[i].find('p', {'class' : 'pv-entity__secondary-title t-14 t-black t-normal'}) 331 | curr_name = curr_name.get_text().strip() 332 | curr_name = curr_name.split('\n')[0].strip() 333 | #print("1st currname", curr_name) 334 | company_names_list.append(curr_name) 335 | except Exception as e: 336 | #print("Experience curr_name Exception:", e) 337 | pass 338 | 339 | try: 340 | if curr_name is None: 341 | curr_name = items[i].find('h3', {'class': 't-16 t-black t-bold'}) 342 | curr_name = curr_name.get_text().strip() 343 | curr_name = curr_name.replace("Company Name\n", '') 344 | company_names_list.append(curr_name) 345 | except Exception as e: 346 | #print("Experience curr_name Exception:", e) 347 | pass 348 | 349 | try: 350 | curr_position = items[i].find('h3', {'class': 't-16 t-black t-bold'}) 351 | curr_position = curr_position.get_text().strip() 352 | curr_position = curr_position.replace("Company Name\n", '') 353 | position_list.append(curr_position) 354 | except Exception as e: 355 | #print("Experience curr_position Exception:", e) 356 | pass 357 | 358 | try: 359 | curr_dates = items[i].find('h4', {'class': 'pv-entity__date-range t-14 t-black--light t-normal'}) 360 | curr_dates = curr_dates.get_text().strip() 361 | curr_dates = curr_dates.replace('Dates Employed\n', '') 362 | dates_employed_list.append(curr_dates) 363 | except Exception as e: 364 | #print("Experience curr_dates Exception:", e) 365 | pass 366 | 367 | try: 368 | curr_description = items[i].find('div', {'class': 'pv-entity__extra-details t-14 t-black--light ember-view'}) 369 | curr_description = curr_description.get_text().strip() 370 | curr_description = curr_description.replace('\n\n\n\n\n see less', '') 371 | curr_description = curr_description.replace('\n\n \n \n\n\n\n\n\n\n\n\n\n', ' ') 372 | curr_description = curr_description.replace('\n\n \n…\n\n see more', '') 373 | curr_description = curr_description.replace('\n ', '.') 374 | curr_description = curr_description.replace('\n\n', '.') 375 | description_list.append(curr_description) 376 | except Exception as e: 377 | #print("Experience curr_description Exception:", e) 378 | pass 379 | #Add empty description for normalization of data 380 | description_list.append('') 381 | 382 | #create company_names_list from above data 383 | for i in range(len(company_names_list)): 384 | experience_info_list.append([company_names_list[i], position_list[i], dates_employed_list[i], description_list[i]]) 385 | 386 | except Exception as e: 387 | #No Experience Added 388 | #print("Experience Section Exception:", e) 389 | pass 390 | #print(experience_info_list) 391 | 392 | 393 | #Skills Section 394 | skills_info_list = [] 395 | try: 396 | skills_section = soup.find('section', {'class': 'pv-profile-section pv-skill-categories-section artdeco-container-card ember-view'}) 397 | except Exception as e: 398 | #print("skills_section Exception", e) 399 | pass 400 | 401 | try: 402 | if skills_section is None: 403 | skills_section = soup.find('section', {'class': 'pv-profile-section pv-skill-categories-section artdeco-container-card first-degree ember-view'}) 404 | 405 | all_skills = skills_section.find_all('span', {'class': 'pv-skill-category-entity__name-text t-16 t-black t-bold'}) 406 | 407 | for i in range(len(all_skills)): 408 | skills_info_list.append(all_skills[i].get_text().strip()) 409 | 410 | except Exception as e: 411 | #No skills added 412 | #print("Skills Section Exception:", e) 413 | pass 414 | 415 | #print(skills_info_list) 416 | 417 | 418 | #Volunteering Section: 419 | volunteer_info_list = [] 420 | items = [] 421 | list_items = [] 422 | try: 423 | volunteer_section = soup.find('section', {'class': 'pv-profile-section volunteering-section ember-view'}) 424 | list_items = volunteer_section.find('ul', {'class': 'pv-profile-section__section-info section-info pv-profile-section__section-info--has-more ember-view'}) 425 | except Exception as e: 426 | #print("Volunteering volunteer_section Exception:", e) 427 | pass 428 | 429 | try: 430 | if list_items is None: 431 | list_items = volunteer_section.find('ul', {'class': 'pv-profile-section__section-info section-info pv-profile-section__section-info--has-no-more'}) 432 | except Exception as e: 433 | #print("Volunteering list_items Exception:", e) 434 | pass 435 | 436 | try: 437 | items = list_items.find_all('li', {'class': 'pv-profile-section__sortable-item pv-profile-section__section-info-item relative pv-profile-section__sortable-item--v2 pv-profile-section__list-item sortable-item ember-view'}) 438 | except Exception as e: 439 | # print("Volunteering list_items Exception:", e) 440 | pass 441 | 442 | try: 443 | if items == []: 444 | items = list_items.find_all('li', {'class': 'pv-profile-section__list-item pv-volunteering-entity pv-profile-section__card-item ember-view'}) 445 | except Exception as e: 446 | # print("Volunteering items Exception:", e) 447 | pass 448 | 449 | try: 450 | for i in range(len(items)): 451 | curr_name = items[i].find('span', {'class': 'pv-entity__secondary-title'}) 452 | curr_name = curr_name.get_text().strip() 453 | 454 | curr_role = items[i].find('h3', {'class': 't-16 t-black t-bold'}) 455 | curr_role = curr_role.get_text().strip() 456 | 457 | try: 458 | curr_dates = items[i].find('h4', {'class': 'pv-entity__date-range detail-facet inline-block t-14 t-black--light t-normal'}) 459 | curr_dates = curr_dates.get_text().strip() 460 | curr_dates = curr_dates.replace('Dates volunteered\n', '') 461 | except Exception as e: 462 | #print("curr_dates Exception", e) 463 | curr_dates = '' 464 | 465 | try: 466 | curr_description = items[i].find('p', {'class': 'pv-entity__description t-14 t-normal mt4'}) 467 | curr_description = curr_description.get_text().strip() 468 | except Exception as e: 469 | #print("curr_description Exception", e) 470 | curr_description = '' 471 | 472 | #Construct volunteer_info_list from above data 473 | volunteer_info_list.append([curr_name, curr_role, curr_dates, curr_description]) 474 | 475 | except Exception as e: 476 | #no volunteering added 477 | #print("Volunteering Section Exception", e) 478 | pass 479 | 480 | try: 481 | # click to expand honors and awards section because only either projects or honors and awards can be expanded at a time 482 | honors_and_awards_expand_button = browser.find_element_by_xpath("//section[@class='pv-profile-section pv-accomplishments-section artdeco-container-card ember-view']//button[@aria-label='Expand honors & awards section']") 483 | browser.execute_script("arguments[0].click();", honors_and_awards_expand_button) 484 | 485 | # click to expand honors and awards section to show more 486 | honors_and_awards_expand_button2 = browser.find_element_by_xpath( 487 | "//section[@class='pv-profile-section pv-accomplishments-section artdeco-container-card ember-view']//button[@aria-controls='honors-expandable-content' and @aria-expanded='false']") 488 | browser.execute_script("arguments[0].click();", honors_and_awards_expand_button2) 489 | except Exception as e: 490 | #print("honors_and_awards_expand_button Exception", e) 491 | pass 492 | 493 | 494 | #accomplishments section 495 | accomplishments_info_list = [] 496 | try: 497 | accomplishments_section = soup.find_all('section', {'class': 'pv-profile-section pv-accomplishments-section artdeco-container-card ember-view'}) 498 | 499 | honors_section = accomplishments_section[0].find('div', {'aria-labelledby': 'honors-title'}) 500 | 501 | list_items = honors_section.find_all('li', {'class': 'pv-accomplishments-block__summary-list-item'}) 502 | 503 | for i in range(len(list_items)): 504 | # appending empty string for year field 505 | accomplishments_info_list.append([list_items[i].get_text().strip(), ""]) 506 | 507 | except Exception as e: 508 | #No accomplishments added 509 | #print("Accomplishments Section Exception", e) 510 | pass 511 | 512 | 513 | #empty hobbies_info_list because it is not available on linkedin 514 | hobbies_info_list = [] 515 | 516 | #Close the browser once scraping is done 517 | browser.close() 518 | 519 | #TESTING OUTPUTS 520 | #print("LISTS") 521 | #print(basic_info_list) 522 | #print(education_info_list) 523 | #print(projects_info_list) 524 | #print(certifications_info_list) 525 | #print(experience_info_list) 526 | #print(skills_info_list) 527 | #print(volunteer_info_list) 528 | #print(accomplishments_info_list) 529 | 530 | final_all_lists = [basic_info_list, education_info_list, projects_info_list, certifications_info_list, experience_info_list, skills_info_list, volunteer_info_list, accomplishments_info_list, hobbies_info_list] 531 | 532 | json_data = {'basic_info_list' : basic_info_list, 'education_info_list': education_info_list, 'projects_info_list': projects_info_list, 'certifications_info_list': certifications_info_list, 'experience_info_list': experience_info_list, 'skills_info_list': skills_info_list, 'volunteer_info_list': volunteer_info_list, 'accomplishments_info_list': accomplishments_info_list, 'hobbies_info_list': hobbies_info_list} 533 | 534 | final_json_string = json.dumps(json_data) 535 | #print(final_json_string) 536 | 537 | fileheader = open("scraped_data.json", 'w') 538 | 539 | fileheader.writelines(final_json_string) 540 | 541 | return (json_data) -------------------------------------------------------------------------------- /static/scripts/formscripts.js: -------------------------------------------------------------------------------- 1 | var list_made=[false,false,false,false,false,false,false,false,false]; 2 | var education_info_list_name=[]; 3 | var projects_info_list_name=[] 4 | var certifications_info_list_name=[] 5 | var experience_info_list_name=[] 6 | var skills_info_list_name=[] 7 | var volunteer_info_list_name=[] 8 | var accomplishments_info_list_name=[] 9 | var hobbies_info_list_name=[] 10 | var ed_str1 = "institute"; 11 | var ed_str2 = "degree"; 12 | var ed_str3 = "year"; 13 | var ed_str4 = "grade"; 14 | var pr_str1 = "projectname"; 15 | var pr_str2 = "projectduration"; 16 | var pr_str3 = "projectdescription"; 17 | var cr_str1 = "certificationname"; 18 | var cr_str2 = "certificationdate"; 19 | var cr_str3 = "certificationorgan"; 20 | var ex_str1 = "expname"; 21 | var ex_str2 = "exprole"; 22 | var ex_str3 = "expdate"; 23 | var ex_str4 = "expdescription"; 24 | var sk_str1 = "skill"; 25 | var vo_str1 = "voname"; 26 | var vo_str2 = "vorole"; 27 | var vo_str3 = "vodate"; 28 | var vo_str4 = "vodescription"; 29 | var ac_str1 = "accname"; 30 | var ac_str2 = "accyear"; 31 | var hb_str1 = "hobby"; 32 | //-->Function loads when page loads 33 | function LoadingFunc(){ 34 | //console.log("loadingfunc function works"); 35 | //console.log(json_string); 36 | //-->which forms have to be visible 37 | var form1 = document.getElementById("f1"); 38 | form1.style.display="block"; 39 | var form2 = document.getElementById("f2"); 40 | form2.style.display="none"; 41 | var form3 = document.getElementById("f3"); 42 | form3.style.display="none"; 43 | var form4 = document.getElementById("f4"); 44 | form4.style.display="none"; 45 | var form5 = document.getElementById("f5"); 46 | form5.style.display="none"; 47 | var form6 = document.getElementById("f6"); 48 | form6.style.display="none"; 49 | var form7 = document.getElementById("f7"); 50 | form7.style.display="none"; 51 | var form8 = document.getElementById("f8"); 52 | form8.style.display="none"; 53 | var form9 = document.getElementById("f9"); 54 | form9.style.display="none"; 55 | //-->declare list to be used in this form 56 | var basic_info_list=[]; 57 | //-->fill the list from main string 58 | for(var i in json_string){ 59 | if(i=="basic_info_list"){ 60 | basic_info_list=json_string[i]; 61 | } 62 | } 63 | //-->add info from list to the form 64 | document.getElementById("fname").value=basic_info_list[0]; 65 | document.getElementById("lname").value=basic_info_list[1]; 66 | document.getElementById("headline").value=basic_info_list[2]; 67 | document.getElementById("linkedin").value=basic_info_list[3]; 68 | //console.log(basic_info_list); 69 | list_made[0]=true; 70 | } 71 | //-->Function loads when you go from form2 -> form1 72 | function clickform1() { 73 | //console.log("clickform1 fucntion works"); 74 | //-->which forms have to be visible 75 | var form1 = document.getElementById("f1"); 76 | form1.style.display="block"; 77 | var form2 = document.getElementById("f2"); 78 | form2.style.display="none"; 79 | var form3 = document.getElementById("f3"); 80 | form3.style.display="none"; 81 | var form4 = document.getElementById("f4"); 82 | form4.style.display="none"; 83 | var form5 = document.getElementById("f5"); 84 | form5.style.display="none"; 85 | var form6 = document.getElementById("f6"); 86 | form6.style.display="none"; 87 | var form7 = document.getElementById("f7"); 88 | form7.style.display="none"; 89 | var form8 = document.getElementById("f8"); 90 | form8.style.display="none"; 91 | var form9 = document.getElementById("f9"); 92 | form9.style.display="none"; 93 | //-->remove previous progress 94 | var progress = document.getElementById("p2"); 95 | progress.classList.remove("active"); 96 | //console.log(basic_info_list2); 97 | } 98 | //-->Funciton to go from form1 -> form2 or from form3 -> form2 99 | function clickform2() { 100 | //console.log("clickform2 function works"); 101 | //-->which forms have to be visible 102 | var form1 = document.getElementById("f1"); 103 | form1.style.display="none"; 104 | var form2 = document.getElementById("f2"); 105 | form2.style.display="block"; 106 | var form3 = document.getElementById("f3"); 107 | form3.style.display="none"; 108 | var form4 = document.getElementById("f4"); 109 | form4.style.display="none"; 110 | var form5 = document.getElementById("f5"); 111 | form5.style.display="none"; 112 | var form6 = document.getElementById("f6"); 113 | form6.style.display="none"; 114 | var form7 = document.getElementById("f7"); 115 | form7.style.display="none"; 116 | var form8 = document.getElementById("f8"); 117 | form8.style.display="none"; 118 | var form9 = document.getElementById("f9"); 119 | form9.style.display="none"; 120 | //-->how much of the progress bar is green 121 | var progress2 = document.getElementById("p2"); 122 | progress2.classList.add("active"); 123 | var progress3 = document.getElementById("p3"); 124 | progress3.classList.remove("active"); 125 | if(list_made[1]==false){ 126 | var lennotzero=true; 127 | //-->declare list to be used in this form 128 | var education_info_list=[]; 129 | //-->fill the list from main string 130 | for (var i in json_string){ 131 | if(i=="education_info_list"){ 132 | if(json_string[i].length>0){ 133 | for(var j=0; jadd new list to the education_info_list 135 | education_info_list[j] = new Array(json_string[i][j].length); 136 | for(var k=0; kdeclare list holding names of of the elements 150 | var count=1; 151 | //-->dynamically change each name depeneding on list index 152 | for(var i in education_info_list){ 153 | education_info_list_name[i] = new Array(education_info_list[i].length) 154 | education_info_list_name[i][0] = ed_str1+count; 155 | education_info_list_name[i][1] = ed_str2+count; 156 | education_info_list_name[i][3] = ed_str3+count; 157 | education_info_list_name[i][4] = ed_str4+count; 158 | count+=1; 159 | } 160 | var len_sublist = education_info_list[i].length; 161 | var label_names = ["Institute:","Degree:","","Year:","% / CGPA :"] 162 | //-->creating elements 163 | for(var i in education_info_list_name){ 164 | var form2 = document.getElementById("f22"); 165 | //-->create subtititle 166 | var subtititle = document.createElement("h3"); 167 | subtititle.className="fs-subtitle"; 168 | var no = parseInt(i)+1; 169 | subtititle.id="sub"+education_info_list_name[no-1][0]; 170 | 171 | var hidden = document.getElementById("hidden_education"); 172 | hidden.innerText=(no); 173 | subtititle.innerText="Institute "+(no); 174 | form2.appendChild(subtititle); 175 | for(var j=0; jnot using data at index 2 177 | if(j==2){ 178 | 179 | } 180 | else{ 181 | //-->create div in which both div of label and input will be present 182 | var div = document.createElement("div"); 183 | div.className="flex-container"; 184 | form2.appendChild(div); 185 | //-->create div of label 186 | var labeldiv = document.createElement("div"); 187 | labeldiv.className="labeldiv"; 188 | labeldiv.id=education_info_list_name[i][j]; 189 | div.appendChild(labeldiv); 190 | //-->create label 191 | var label = document.createElement("label"); 192 | label.innerText=label_names[j]; 193 | labeldiv.appendChild(label); 194 | //-->create input 195 | var input = document.createElement("input"); 196 | input.type="text"; 197 | input.value=education_info_list[i][j]; 198 | //-->put value from list into input element 199 | input.name=education_info_list_name[i][j]; 200 | div.appendChild(input); 201 | } 202 | } 203 | } 204 | } 205 | var form2 = document.getElementById("f22"); 206 | //-->create div in which remove button will be present 207 | var div = document.createElement("div"); 208 | div.className="flex-container"; 209 | form2.appendChild(div); 210 | //-->create remove button 211 | var remove_button = document.createElement("input"); 212 | remove_button.type="button"; 213 | remove_button.name="remove_institute"; 214 | remove_button.className="remove"; 215 | remove_button.onclick=removeinstitute; 216 | remove_button.value="Remove"; 217 | remove_button.id="edu_remove"; 218 | div.appendChild(remove_button); 219 | //-->create add button 220 | var add_button = document.createElement("input"); 221 | add_button.type="button"; 222 | add_button.name="add_institute"; 223 | add_button.className="add"; 224 | add_button.onclick=addinstitute; 225 | add_button.value="Add"; 226 | add_button.id="edu_add"; 227 | div.appendChild(add_button); 228 | //-->create div in which both previous and next button will be present 229 | var div = document.createElement("div"); 230 | div.className="flex-container"; 231 | form2.appendChild(div); 232 | //-->create previous button 233 | var previous_button = document.createElement("input"); 234 | previous_button.type="button"; 235 | previous_button.name="previous"; 236 | previous_button.className="previous action-button"; 237 | previous_button.onclick=clickform1; 238 | previous_button.value="Previous"; 239 | previous_button.id="edu_previous"; 240 | div.appendChild(previous_button); 241 | //-->create next button 242 | var next_button = document.createElement("input"); 243 | next_button.type="button"; 244 | next_button.name="next"; 245 | next_button.className="next action-button"; 246 | next_button.onclick=clickform3; 247 | next_button.value="Next"; 248 | next_button.id="edu_next"; 249 | div.appendChild(next_button); 250 | list_made[1]=true; 251 | } 252 | 253 | 254 | //basic_info_list2.push(document.getElementById("fname").value); 255 | } 256 | function addinstitute(){ 257 | //-->which forms have to be visible 258 | var form1 = document.getElementById("f1"); 259 | form1.style.display="none"; 260 | var form2 = document.getElementById("f2"); 261 | form2.style.display="block"; 262 | var form3 = document.getElementById("f3"); 263 | form3.style.display="none"; 264 | var form4 = document.getElementById("f4"); 265 | form4.style.display="none"; 266 | var form5 = document.getElementById("f5"); 267 | form5.style.display="none"; 268 | var form6 = document.getElementById("f6"); 269 | form6.style.display="none"; 270 | var form7 = document.getElementById("f7"); 271 | form7.style.display="none"; 272 | var form8 = document.getElementById("f8"); 273 | form8.style.display="none"; 274 | var form9 = document.getElementById("f9"); 275 | form9.style.display="none"; 276 | //-->how much of the progress bar is green 277 | var progress2 = document.getElementById("p2"); 278 | progress2.classList.add("active"); 279 | var progress3 = document.getElementById("p3"); 280 | progress3.classList.remove("active"); 281 | //-->how many institutes already present 282 | var hidden = document.getElementById("hidden_education"); 283 | var no = parseInt(hidden.innerText); 284 | //-->remove buttons 285 | var add_button = document.getElementById("edu_add"); 286 | add_button.remove(); 287 | var remove_button = document.getElementById("edu_remove"); 288 | remove_button.remove(); 289 | var previous_button = document.getElementById("edu_previous"); 290 | previous_button.remove(); 291 | var next_button = document.getElementById("edu_next"); 292 | next_button.remove(); 293 | //-->add elements 294 | var form2 = document.getElementById("f22"); 295 | 296 | var no = no+1; 297 | 298 | hidden.innerText=(no); 299 | 300 | //-->add elements in education_info_list_name 301 | education_info_list_name[no-1] = new Array(5) 302 | education_info_list_name[no-1][0] = ed_str1+no; 303 | education_info_list_name[no-1][1] = ed_str2+no; 304 | education_info_list_name[no-1][3] = ed_str3+no; 305 | education_info_list_name[no-1][4] = ed_str4+no; 306 | //-->create subtititle 307 | var subtititle = document.createElement("h3"); 308 | subtititle.className="fs-subtitle"; 309 | subtititle.id="sub"+education_info_list_name[no-1][0]; 310 | subtititle.innerText="Institute "+(no); 311 | form2.appendChild(subtititle); 312 | //-->add rest of the elements 313 | var label_names = ["Institute:","Degree:","","Year:","% / CGPA :"] 314 | for(var i=0; i<5; i++){ 315 | if(i==2){ 316 | 317 | } 318 | else{ 319 | //-->create div in which both div of label and input will be present 320 | var div = document.createElement("div"); 321 | div.className="flex-container"; 322 | form2.appendChild(div); 323 | //-->create div of label 324 | var labeldiv = document.createElement("div"); 325 | labeldiv.className="labeldiv"; 326 | div.appendChild(labeldiv); 327 | //-->create label 328 | var label = document.createElement("label"); 329 | label.innerText=label_names[i]; 330 | labeldiv.id=education_info_list_name[no-1][i]; 331 | labeldiv.appendChild(label); 332 | //-->create input 333 | var input = document.createElement("input"); 334 | input.type="text"; 335 | input.name=education_info_list_name[no-1][i]; 336 | div.appendChild(input); 337 | } 338 | } 339 | var form2 = document.getElementById("f22"); 340 | //-->create div in which add button will be present 341 | var div = document.createElement("div"); 342 | div.className="flex-container"; 343 | form2.appendChild(div); 344 | //-->create remove button 345 | var remove_button = document.createElement("input"); 346 | remove_button.type="button"; 347 | remove_button.name="remove_institute"; 348 | remove_button.className="remove"; 349 | remove_button.onclick=removeinstitute; 350 | remove_button.value="Remove"; 351 | remove_button.id="edu_remove"; 352 | div.appendChild(remove_button); 353 | //-->create add button 354 | var add_button = document.createElement("input"); 355 | add_button.type="button"; 356 | add_button.name="add_institute"; 357 | add_button.className="add"; 358 | add_button.onclick=addinstitute; 359 | add_button.value="Add"; 360 | add_button.id="edu_add"; 361 | div.appendChild(add_button); 362 | //-->create div in which both previous and next button will be present 363 | var div = document.createElement("div"); 364 | div.className="flex-container"; 365 | form2.appendChild(div); 366 | //-->create previous button 367 | var previous_button = document.createElement("input"); 368 | previous_button.type="button"; 369 | previous_button.name="previous"; 370 | previous_button.className="previous action-button"; 371 | previous_button.onclick=clickform1; 372 | previous_button.value="Previous"; 373 | previous_button.id="edu_previous"; 374 | div.appendChild(previous_button); 375 | //-->create next button 376 | var next_button = document.createElement("input"); 377 | next_button.type="button"; 378 | next_button.name="next"; 379 | next_button.className="next action-button"; 380 | next_button.onclick=clickform3; 381 | next_button.value="Next"; 382 | next_button.id="edu_next"; 383 | div.appendChild(next_button); 384 | } 385 | function removeinstitute(){ 386 | //-->which forms have to be visible 387 | var form1 = document.getElementById("f1"); 388 | form1.style.display="none"; 389 | var form2 = document.getElementById("f2"); 390 | form2.style.display="block"; 391 | var form3 = document.getElementById("f3"); 392 | form3.style.display="none"; 393 | var form4 = document.getElementById("f4"); 394 | form4.style.display="none"; 395 | var form5 = document.getElementById("f5"); 396 | form5.style.display="none"; 397 | var form6 = document.getElementById("f6"); 398 | form6.style.display="none"; 399 | var form7 = document.getElementById("f7"); 400 | form7.style.display="none"; 401 | var form8 = document.getElementById("f8"); 402 | form8.style.display="none"; 403 | var form9 = document.getElementById("f9"); 404 | form9.style.display="none"; 405 | //-->how much of the progress bar is green 406 | var progress2 = document.getElementById("p2"); 407 | progress2.classList.add("active"); 408 | var progress3 = document.getElementById("p3"); 409 | progress3.classList.remove("active"); 410 | //-->how many institutes already present 411 | var hidden = document.getElementById("hidden_education"); 412 | var no = parseInt(hidden.innerText); 413 | //-->remove most current subtitle 414 | var subtititle = document.getElementById("sub"+education_info_list_name[no-1][0]); 415 | subtititle.remove(); 416 | //-->remove most current labels and textfields 417 | for(var i=0; i<5; i++){ 418 | if(i==2){ 419 | 420 | } 421 | else{ 422 | //-->remove text fields 423 | var text = document.getElementsByName(education_info_list_name[no-1][i]); 424 | text[0].remove(); 425 | //-->remove labels 426 | var label = document.getElementById(education_info_list_name[no-1][i]); 427 | label.remove(); 428 | } 429 | } 430 | //-->update education_info_list_name 431 | for(var i=4; i>=0; i--){ 432 | education_info_list_name[no-1].splice(i,1); 433 | } 434 | education_info_list_name.splice((no-1),1); 435 | hidden.innerText=(no-1); 436 | //console.log(education_info_list_name); 437 | } 438 | //-->Function to go from form2 -> form3 or from form4 -> form3 439 | function clickform3() { 440 | //console.log("Function form3 works"); 441 | //-->which forms have to be visible 442 | var form1 = document.getElementById("f1"); 443 | form1.style.display="none"; 444 | var form2 = document.getElementById("f2"); 445 | form2.style.display="none"; 446 | var form3 = document.getElementById("f3"); 447 | form3.style.display="block"; 448 | var form4 = document.getElementById("f4"); 449 | form4.style.display="none"; 450 | var form5 = document.getElementById("f5"); 451 | form5.style.display="none"; 452 | var form6 = document.getElementById("f6"); 453 | form6.style.display="none"; 454 | var form7 = document.getElementById("f7"); 455 | form7.style.display="none"; 456 | var form8 = document.getElementById("f8"); 457 | form8.style.display="none"; 458 | var form9 = document.getElementById("f9"); 459 | form9.style.display="none"; 460 | //-->how much of the progress bar is green 461 | var progress = document.getElementById("p3"); 462 | progress.classList.add("active"); 463 | var progress = document.getElementById("p4"); 464 | progress.classList.remove("active"); 465 | if(list_made[2]==false){ 466 | var lennotzero=true; 467 | //-->declare list to be used in this form 468 | var projects_info_list=[]; 469 | //-->fill the list from main string 470 | for (var i in json_string){ 471 | if(i=="projects_info_list"){ 472 | if(json_string[i].length>0){ 473 | for(var j=0; jadd new list to the projects_info_list 475 | projects_info_list[j] = new Array(json_string[i][j].length); 476 | for(var k=0; kdeclare list holding names of of the elements 490 | var count=1; 491 | //-->dynamically change each name depeneding on list index 492 | for(var i in projects_info_list){ 493 | projects_info_list_name[i] = new Array(projects_info_list[i].length) 494 | projects_info_list_name[i][0] = pr_str1+count; 495 | projects_info_list_name[i][1] = pr_str2+count; 496 | projects_info_list_name[i][2] = pr_str3+count; 497 | count+=1; 498 | } 499 | var len_sublist = projects_info_list[i].length; 500 | var label_names = ["Name:","Duration:","Description:"] 501 | //console.log(projects_info_list_name); 502 | //-->creating elements 503 | for(var i in projects_info_list_name){ 504 | var form3 = document.getElementById("f33"); 505 | //-->create subtititle 506 | var subtititle = document.createElement("h3"); 507 | subtititle.className="fs-subtitle"; 508 | var no = parseInt(i)+1; 509 | subtititle.id="sub"+projects_info_list_name[no-1][0]; 510 | var hidden = document.getElementById("hidden_projects"); 511 | hidden.innerText=(no); 512 | subtititle.innerText="Project "+(no); 513 | form3.appendChild(subtititle); 514 | for(var j=0; jcreate div in which both div of label and input will be present 516 | var div = document.createElement("div"); 517 | div.className="flex-container"; 518 | form3.appendChild(div); 519 | //-->create div of label 520 | var labeldiv = document.createElement("div"); 521 | labeldiv.className="labeldiv"; 522 | labeldiv.id=projects_info_list_name[i][j]; 523 | div.appendChild(labeldiv); 524 | //-->create label 525 | var label = document.createElement("label"); 526 | label.innerText=label_names[j]; 527 | labeldiv.appendChild(label); 528 | //-->create input 529 | if(j==2){ 530 | var input = document.createElement("textarea"); 531 | input.type="text"; 532 | input.value=projects_info_list[i][j]; 533 | //-->put value from list into input element 534 | input.name=projects_info_list_name[i][j]; 535 | div.appendChild(input); 536 | } 537 | else{ 538 | var input = document.createElement("input"); 539 | input.type="text"; 540 | input.value=projects_info_list[i][j]; 541 | //-->put value from list into input element 542 | input.name=projects_info_list_name[i][j]; 543 | div.appendChild(input); 544 | } 545 | 546 | } 547 | } 548 | } 549 | var form3 = document.getElementById("f33"); 550 | //-->create div in which remove button will be present 551 | var div = document.createElement("div"); 552 | div.className="flex-container"; 553 | form3.appendChild(div); 554 | //-->create remove button 555 | var remove_button = document.createElement("input"); 556 | remove_button.type="button"; 557 | remove_button.name="remove_project"; 558 | remove_button.className="remove"; 559 | remove_button.onclick=removeproject; 560 | remove_button.value="Remove"; 561 | remove_button.id="pr_remove"; 562 | div.appendChild(remove_button); 563 | //-->create add button 564 | var add_button = document.createElement("input"); 565 | add_button.type="button"; 566 | add_button.name="add_project"; 567 | add_button.className="add"; 568 | add_button.onclick=addproject; 569 | add_button.value="Add"; 570 | add_button.id="pr_add"; 571 | div.appendChild(add_button); 572 | //-->create div in which both previous and next button will be present 573 | var div = document.createElement("div"); 574 | div.className="flex-container"; 575 | form3.appendChild(div); 576 | //-->create previous button 577 | var previous_button = document.createElement("input"); 578 | previous_button.type="button"; 579 | previous_button.name="previous"; 580 | previous_button.className="previous action-button"; 581 | previous_button.onclick=clickform2; 582 | previous_button.value="Previous"; 583 | previous_button.id="pr_previous"; 584 | div.appendChild(previous_button); 585 | //-->create next button 586 | var next_button = document.createElement("input"); 587 | next_button.type="button"; 588 | next_button.name="next"; 589 | next_button.className="next action-button"; 590 | next_button.onclick=clickform4; 591 | next_button.value="Next"; 592 | next_button.id="pr_next"; 593 | div.appendChild(next_button); 594 | list_made[2]=true; 595 | } 596 | } 597 | function addproject(){ 598 | //-->which forms have to be visible 599 | var form1 = document.getElementById("f1"); 600 | form1.style.display="none"; 601 | var form2 = document.getElementById("f2"); 602 | form2.style.display="none"; 603 | var form3 = document.getElementById("f3"); 604 | form3.style.display="block"; 605 | var form4 = document.getElementById("f4"); 606 | form4.style.display="none"; 607 | var form5 = document.getElementById("f5"); 608 | form5.style.display="none"; 609 | var form6 = document.getElementById("f6"); 610 | form6.style.display="none"; 611 | var form7 = document.getElementById("f7"); 612 | form7.style.display="none"; 613 | var form8 = document.getElementById("f8"); 614 | form8.style.display="none"; 615 | var form9 = document.getElementById("f9"); 616 | form9.style.display="none"; 617 | //-->how much of the progress bar is green 618 | //-->how much of the progress bar is green 619 | var progress = document.getElementById("p3"); 620 | progress.classList.add("active"); 621 | var progress = document.getElementById("p4"); 622 | progress.classList.remove("active"); 623 | //-->how many institutes already present 624 | var hidden = document.getElementById("hidden_projects"); 625 | var no = parseInt(hidden.innerText); 626 | //-->remove buttons 627 | var add_button = document.getElementById("pr_add"); 628 | add_button.remove(); 629 | var remove_button = document.getElementById("pr_remove"); 630 | remove_button.remove(); 631 | var previous_button = document.getElementById("pr_previous"); 632 | previous_button.remove(); 633 | var next_button = document.getElementById("pr_next"); 634 | next_button.remove(); 635 | //-->add elements 636 | var form3 = document.getElementById("f33"); 637 | var no = no+1; 638 | hidden.innerText=(no); 639 | //-->add elements in education_info_list_name 640 | projects_info_list_name[no-1] = new Array(3) 641 | projects_info_list_name[no-1][0] = pr_str1+no; 642 | projects_info_list_name[no-1][1] = pr_str2+no; 643 | projects_info_list_name[no-1][2] = pr_str3+no; 644 | //-->create subtititle 645 | var subtititle = document.createElement("h3"); 646 | subtititle.className="fs-subtitle"; 647 | subtititle.id="sub"+projects_info_list_name[no-1][0]; 648 | subtititle.innerText="Project "+(no); 649 | form3.appendChild(subtititle); 650 | //-->add rest of the elements 651 | var label_names = ["Name:","Duration:","Description:"] 652 | for(var i=0; i<3; i++){ 653 | //-->create div in which both div of label and input will be present 654 | var div = document.createElement("div"); 655 | div.className="flex-container"; 656 | form3.appendChild(div); 657 | //-->create div of label 658 | var labeldiv = document.createElement("div"); 659 | labeldiv.className="labeldiv"; 660 | div.appendChild(labeldiv); 661 | //-->create label 662 | var label = document.createElement("label"); 663 | label.innerText=label_names[i]; 664 | labeldiv.id=projects_info_list_name[no-1][i]; 665 | labeldiv.appendChild(label); 666 | //-->create input 667 | if(i==2){ 668 | var input = document.createElement("textarea"); 669 | input.type="text"; 670 | input.name=projects_info_list_name[no-1][i]; 671 | div.appendChild(input); 672 | } 673 | else{ 674 | var input = document.createElement("input"); 675 | input.type="text"; 676 | input.name=projects_info_list_name[no-1][i]; 677 | div.appendChild(input); 678 | } 679 | 680 | } 681 | var form3 = document.getElementById("f33"); 682 | //-->create div in which remove button will be present 683 | var div = document.createElement("div"); 684 | div.className="flex-container"; 685 | form3.appendChild(div); 686 | //-->create remove button 687 | var remove_button = document.createElement("input"); 688 | remove_button.type="button"; 689 | remove_button.name="remove_project"; 690 | remove_button.className="remove"; 691 | remove_button.onclick=removeproject; 692 | remove_button.value="Remove"; 693 | remove_button.id="pr_remove"; 694 | div.appendChild(remove_button); 695 | //-->create add button 696 | var add_button = document.createElement("input"); 697 | add_button.type="button"; 698 | add_button.name="add_project"; 699 | add_button.className="add"; 700 | add_button.onclick=addproject; 701 | add_button.value="Add"; 702 | add_button.id="pr_add"; 703 | div.appendChild(add_button); 704 | //-->create div in which both previous and next button will be present 705 | var div = document.createElement("div"); 706 | div.className="flex-container"; 707 | form3.appendChild(div); 708 | //-->create previous button 709 | var previous_button = document.createElement("input"); 710 | previous_button.type="button"; 711 | previous_button.name="previous"; 712 | previous_button.className="previous action-button"; 713 | previous_button.onclick=clickform2; 714 | previous_button.value="Previous"; 715 | previous_button.id="pr_previous"; 716 | div.appendChild(previous_button); 717 | //-->create next button 718 | var next_button = document.createElement("input"); 719 | next_button.type="button"; 720 | next_button.name="next"; 721 | next_button.className="next action-button"; 722 | next_button.onclick=clickform4; 723 | next_button.value="Next"; 724 | next_button.id="pr_next"; 725 | div.appendChild(next_button); 726 | } 727 | function removeproject(){ 728 | //-->which forms have to be visible 729 | var form1 = document.getElementById("f1"); 730 | form1.style.display="none"; 731 | var form2 = document.getElementById("f2"); 732 | form2.style.display="none"; 733 | var form3 = document.getElementById("f3"); 734 | form3.style.display="block"; 735 | var form4 = document.getElementById("f4"); 736 | form4.style.display="none"; 737 | var form5 = document.getElementById("f5"); 738 | form5.style.display="none"; 739 | var form6 = document.getElementById("f6"); 740 | form6.style.display="none"; 741 | var form7 = document.getElementById("f7"); 742 | form7.style.display="none"; 743 | var form8 = document.getElementById("f8"); 744 | form8.style.display="none"; 745 | var form9 = document.getElementById("f9"); 746 | form9.style.display="none"; 747 | //-->how much of the progress bar is green 748 | var progress = document.getElementById("p3"); 749 | progress.classList.add("active"); 750 | var progress = document.getElementById("p4"); 751 | progress.classList.remove("active"); 752 | //-->how many institutes already present 753 | var hidden = document.getElementById("hidden_projects"); 754 | var no = parseInt(hidden.innerText); 755 | //-->remove most current subtitle 756 | var subtititle = document.getElementById("sub"+projects_info_list_name[no-1][0]); 757 | subtititle.remove(); 758 | //-->remove most current labels and textfields 759 | for(var i=0; i<3; i++){ 760 | //-->remove text fields 761 | var text = document.getElementsByName(projects_info_list_name[no-1][i]); 762 | text[0].remove(); 763 | //-->remove labels 764 | var label = document.getElementById(projects_info_list_name[no-1][i]); 765 | label.remove(); 766 | } 767 | //-->update projects_info_list_name 768 | for(var i=2; i>=0; i--){ 769 | projects_info_list_name[no-1].splice(i,1); 770 | } 771 | projects_info_list_name.splice((no-1),1); 772 | hidden.innerText=(no-1); 773 | } 774 | //-->Function to go from form3 -> form4 or from form5 -> form4 775 | function clickform4(){ 776 | //console.log("Function form4 works"); 777 | //-->which forms have to be visible 778 | var form1 = document.getElementById("f1"); 779 | form1.style.display="none"; 780 | var form2 = document.getElementById("f2"); 781 | form2.style.display="none"; 782 | var form3 = document.getElementById("f3"); 783 | form3.style.display="none"; 784 | var form4 = document.getElementById("f4"); 785 | form4.style.display="block"; 786 | var form5 = document.getElementById("f5"); 787 | form5.style.display="none"; 788 | var form6 = document.getElementById("f6"); 789 | form6.style.display="none"; 790 | var form7 = document.getElementById("f7"); 791 | form7.style.display="none"; 792 | var form8 = document.getElementById("f8"); 793 | form8.style.display="none"; 794 | var form9 = document.getElementById("f9"); 795 | form9.style.display="none"; 796 | //-->how much of the progress bar is green 797 | var progress = document.getElementById("p4"); 798 | progress.classList.add("active"); 799 | var progress = document.getElementById("p5"); 800 | progress.classList.remove("active"); 801 | if(list_made[3]==false){ 802 | var lennotzero=true; 803 | //-->declare list to be used in this form 804 | var certifications_info_list=[]; 805 | //-->fill the list from main string 806 | for (var i in json_string){ 807 | if(i=="certifications_info_list"){ 808 | if(json_string[i].length>0){ 809 | for(var j=0; jadd new list to the certifications_info_list 811 | certifications_info_list[j] = new Array(json_string[i][j].length); 812 | for(var k=0; kdeclare list holding names of of the elements 826 | var count=1; 827 | //-->dynamically change each name depeneding on list index 828 | for(var i in certifications_info_list){ 829 | certifications_info_list_name[i] = new Array(certifications_info_list[i].length) 830 | certifications_info_list_name[i][0] = cr_str1+count; 831 | certifications_info_list_name[i][1] = cr_str2+count; 832 | certifications_info_list_name[i][2] = cr_str3+count; 833 | count+=1; 834 | } 835 | var len_sublist = certifications_info_list[i].length; 836 | var label_names = ["Name:","Issue Date:","Organisation:"] 837 | //console.log(certifications_info_list_name); 838 | //-->creating elements 839 | for(var i in certifications_info_list){ 840 | var form4 = document.getElementById("f44"); 841 | //-->create subtititle 842 | var subtititle = document.createElement("h3"); 843 | subtititle.className="fs-subtitle"; 844 | var no = parseInt(i)+1; 845 | subtititle.id="sub"+certifications_info_list[no-1][0]; 846 | var hidden = document.getElementById("hidden_certifications"); 847 | hidden.innerText=(no); 848 | subtititle.innerText="Certification "+(no); 849 | form4.appendChild(subtititle); 850 | for(var j=0; jcreate div in which both div of label and input will be present 852 | var div = document.createElement("div"); 853 | div.className="flex-container"; 854 | form4.appendChild(div); 855 | //-->create div of label 856 | var labeldiv = document.createElement("div"); 857 | labeldiv.className="labeldiv"; 858 | labeldiv.id=certifications_info_list_name[i][j]; 859 | div.appendChild(labeldiv); 860 | //-->create label 861 | var label = document.createElement("label"); 862 | label.innerText=label_names[j]; 863 | labeldiv.appendChild(label); 864 | //-->create input 865 | var input = document.createElement("input"); 866 | input.type="text"; 867 | input.value=certifications_info_list[i][j]; 868 | //-->put value from list into input element 869 | input.name=certifications_info_list_name[i][j]; 870 | div.appendChild(input); 871 | } 872 | } 873 | } 874 | var form4 = document.getElementById("f44"); 875 | //-->create div in which remove button will be present 876 | var div = document.createElement("div"); 877 | div.className="flex-container"; 878 | form4.appendChild(div); 879 | //-->create remove button 880 | var remove_button = document.createElement("input"); 881 | remove_button.type="button"; 882 | remove_button.name="remove_certification"; 883 | remove_button.className="remove"; 884 | remove_button.onclick=removecertification; 885 | remove_button.value="Remove"; 886 | remove_button.id="cr_remove"; 887 | div.appendChild(remove_button); 888 | //-->create add button 889 | var add_button = document.createElement("input"); 890 | add_button.type="button"; 891 | add_button.name="add_certification"; 892 | add_button.className="add"; 893 | add_button.onclick=addcertification; 894 | add_button.value="Add"; 895 | add_button.id="cr_add"; 896 | div.appendChild(add_button); 897 | //-->create div in which both previous and next button will be present 898 | var div = document.createElement("div"); 899 | div.className="flex-container"; 900 | form4.appendChild(div); 901 | //-->create previous button 902 | var previous_button = document.createElement("input"); 903 | previous_button.type="button"; 904 | previous_button.name="previous"; 905 | previous_button.className="previous action-button"; 906 | previous_button.onclick=clickform3; 907 | previous_button.value="Previous"; 908 | previous_button.id="cr_previous"; 909 | div.appendChild(previous_button); 910 | //-->create next button 911 | var next_button = document.createElement("input"); 912 | next_button.type="button"; 913 | next_button.name="next"; 914 | next_button.className="next action-button"; 915 | next_button.onclick=clickform5; 916 | next_button.value="Next"; 917 | next_button.id="cr_next"; 918 | div.appendChild(next_button); 919 | list_made[3]=true; 920 | } 921 | } 922 | function addcertification(){ 923 | //-->which forms have to be visible 924 | var form1 = document.getElementById("f1"); 925 | form1.style.display="none"; 926 | var form2 = document.getElementById("f2"); 927 | form2.style.display="none"; 928 | var form3 = document.getElementById("f3"); 929 | form3.style.display="none"; 930 | var form4 = document.getElementById("f4"); 931 | form4.style.display="block"; 932 | var form5 = document.getElementById("f5"); 933 | form5.style.display="none"; 934 | var form6 = document.getElementById("f6"); 935 | form6.style.display="none"; 936 | var form7 = document.getElementById("f7"); 937 | form7.style.display="none"; 938 | var form8 = document.getElementById("f8"); 939 | form8.style.display="none"; 940 | var form9 = document.getElementById("f9"); 941 | form9.style.display="none"; 942 | //-->how much of the progress bar is green 943 | var progress = document.getElementById("p4"); 944 | progress.classList.add("active"); 945 | var progress = document.getElementById("p5"); 946 | progress.classList.remove("active"); 947 | //-->how many institutes already present 948 | var hidden = document.getElementById("hidden_certifications"); 949 | var no = parseInt(hidden.innerText); 950 | //-->remove buttons 951 | var add_button = document.getElementById("cr_add"); 952 | add_button.remove(); 953 | var remove_button = document.getElementById("cr_remove"); 954 | remove_button.remove(); 955 | var previous_button = document.getElementById("cr_previous"); 956 | previous_button.remove(); 957 | var next_button = document.getElementById("cr_next"); 958 | next_button.remove(); 959 | //-->add elements 960 | var form4 = document.getElementById("f44"); 961 | var no = no+1; 962 | hidden.innerText=(no); 963 | //-->add elements in education_info_list_name 964 | certifications_info_list_name[no-1] = new Array(3) 965 | certifications_info_list_name[no-1][0] = cr_str1+no; 966 | certifications_info_list_name[no-1][1] = cr_str2+no; 967 | certifications_info_list_name[no-1][2] = cr_str3+no; 968 | //-->create subtititle 969 | var subtititle = document.createElement("h3"); 970 | subtititle.className="fs-subtitle"; 971 | subtititle.id="sub"+certifications_info_list_name[no-1][0]; 972 | subtititle.innerText="Certification "+(no); 973 | form4.appendChild(subtititle); 974 | //-->add rest of the elements 975 | var label_names = ["Name:","Issue Date:","Organisation:"] 976 | for(var i=0; i<3; i++){ 977 | //-->create div in which both div of label and input will be present 978 | var div = document.createElement("div"); 979 | div.className="flex-container"; 980 | form4.appendChild(div); 981 | //-->create div of label 982 | var labeldiv = document.createElement("div"); 983 | labeldiv.className="labeldiv"; 984 | div.appendChild(labeldiv); 985 | //-->create label 986 | var label = document.createElement("label"); 987 | label.innerText=label_names[i]; 988 | labeldiv.id=certifications_info_list_name[no-1][i]; 989 | labeldiv.appendChild(label); 990 | //-->create input 991 | var input = document.createElement("input"); 992 | input.type="text"; 993 | input.name=certifications_info_list_name[no-1][i]; 994 | div.appendChild(input); 995 | } 996 | var form4 = document.getElementById("f44"); 997 | //-->create div in which remove button will be present 998 | var div = document.createElement("div"); 999 | div.className="flex-container"; 1000 | form4.appendChild(div); 1001 | //-->create remove button 1002 | var remove_button = document.createElement("input"); 1003 | remove_button.type="button"; 1004 | remove_button.name="remove_certification"; 1005 | remove_button.className="remove"; 1006 | remove_button.onclick=removecertification; 1007 | remove_button.value="Remove"; 1008 | remove_button.id="cr_remove"; 1009 | div.appendChild(remove_button); 1010 | //-->create add button 1011 | var add_button = document.createElement("input"); 1012 | add_button.type="button"; 1013 | add_button.name="add_certificatino"; 1014 | add_button.className="add"; 1015 | add_button.onclick=addcertification; 1016 | add_button.value="Add"; 1017 | add_button.id="cr_add"; 1018 | div.appendChild(add_button); 1019 | //-->create div in which both previous and next button will be present 1020 | var div = document.createElement("div"); 1021 | div.className="flex-container"; 1022 | form4.appendChild(div); 1023 | //-->create previous button 1024 | var previous_button = document.createElement("input"); 1025 | previous_button.type="button"; 1026 | previous_button.name="previous"; 1027 | previous_button.className="previous action-button"; 1028 | previous_button.onclick=clickform3; 1029 | previous_button.value="Previous"; 1030 | previous_button.id="cr_previous"; 1031 | div.appendChild(previous_button); 1032 | //-->create next button 1033 | var next_button = document.createElement("input"); 1034 | next_button.type="button"; 1035 | next_button.name="next"; 1036 | next_button.className="next action-button"; 1037 | next_button.onclick=clickform5; 1038 | next_button.value="Next"; 1039 | next_button.id="cr_next"; 1040 | div.appendChild(next_button); 1041 | } 1042 | function removecertification(){ 1043 | //-->which forms have to be visible 1044 | var form1 = document.getElementById("f1"); 1045 | form1.style.display="none"; 1046 | var form2 = document.getElementById("f2"); 1047 | form2.style.display="none"; 1048 | var form3 = document.getElementById("f3"); 1049 | form3.style.display="none"; 1050 | var form4 = document.getElementById("f4"); 1051 | form4.style.display="block"; 1052 | var form5 = document.getElementById("f5"); 1053 | form5.style.display="none"; 1054 | var form6 = document.getElementById("f6"); 1055 | form6.style.display="none"; 1056 | var form7 = document.getElementById("f7"); 1057 | form7.style.display="none"; 1058 | var form8 = document.getElementById("f8"); 1059 | form8.style.display="none"; 1060 | var form9 = document.getElementById("f9"); 1061 | form9.style.display="none"; 1062 | //-->how much of the progress bar is green 1063 | var progress = document.getElementById("p4"); 1064 | progress.classList.add("active"); 1065 | var progress = document.getElementById("p5"); 1066 | progress.classList.remove("active"); 1067 | 1068 | //-->how many institutes already present 1069 | var hidden = document.getElementById("hidden_certifications"); 1070 | var no = parseInt(hidden.innerText); 1071 | //-->remove most current subtitle 1072 | var subtititle = document.getElementById("sub"+certifications_info_list_name[no-1][0]); 1073 | subtititle.remove(); 1074 | //-->remove most current labels and textfields 1075 | for(var i=0; i<3; i++){ 1076 | //-->remove text fields 1077 | var text = document.getElementsByName(certifications_info_list_name[no-1][i]); 1078 | text[0].remove(); 1079 | //-->remove labels 1080 | var label = document.getElementById(certifications_info_list_name[no-1][i]); 1081 | label.remove(); 1082 | } 1083 | //-->update projects_info_list_name 1084 | for(var i=2; i>=0; i--){ 1085 | certifications_info_list_name[no-1].splice(i,1); 1086 | } 1087 | certifications_info_list_name.splice((no-1),1); 1088 | hidden.innerText=(no-1); 1089 | } 1090 | //-->Function to go from form4 -> form5 or from form6 -> form5 1091 | function clickform5(){ 1092 | //-->which forms have to be visible 1093 | var form1 = document.getElementById("f1"); 1094 | form1.style.display="none"; 1095 | var form2 = document.getElementById("f2"); 1096 | form2.style.display="none"; 1097 | var form3 = document.getElementById("f3"); 1098 | form3.style.display="none"; 1099 | var form4 = document.getElementById("f4"); 1100 | form4.style.display="none"; 1101 | var form5 = document.getElementById("f5"); 1102 | form5.style.display="block"; 1103 | var form6 = document.getElementById("f6"); 1104 | form6.style.display="none"; 1105 | var form7 = document.getElementById("f7"); 1106 | form7.style.display="none"; 1107 | var form8 = document.getElementById("f8"); 1108 | form8.style.display="none"; 1109 | var form9 = document.getElementById("f9"); 1110 | form9.style.display="none"; 1111 | //-->how much of the progress bar is green 1112 | var progress = document.getElementById("p5"); 1113 | progress.classList.add("active"); 1114 | var progress = document.getElementById("p6"); 1115 | progress.classList.remove("active"); 1116 | if(list_made[4]==false){ 1117 | var lennotzero=true; 1118 | //-->declare list to be used in this form 1119 | var experience_info_list=[]; 1120 | //-->fill the list from main string 1121 | for (var i in json_string){ 1122 | if(i=="experience_info_list"){ 1123 | //console.log("inside if1"); 1124 | //console.log(json_string[i]); 1125 | if(json_string[i].length>0){ 1126 | //console.log("inside if2"); 1127 | for(var j=0; jadd new list to the certifications_info_list 1129 | experience_info_list[j] = new Array(json_string[i][j].length); 1130 | for(var k=0; kdeclare list holding names of of the elements 1145 | var count=1; 1146 | //-->dynamically change each name depeneding on list index 1147 | for(var i in experience_info_list){ 1148 | experience_info_list_name[i] = new Array(experience_info_list[i].length) 1149 | experience_info_list_name[i][0] = ex_str1+count; 1150 | experience_info_list_name[i][1] = ex_str2+count; 1151 | experience_info_list_name[i][2] = ex_str3+count; 1152 | experience_info_list_name[i][3] = ex_str4+count; 1153 | count+=1; 1154 | } 1155 | var len_sublist = experience_info_list[i].length; 1156 | var label_names = ["Company:","Role:","Duration:","Description"]; 1157 | //console.log(experience_info_list_name); 1158 | //-->creating elements 1159 | for(var i in experience_info_list){ 1160 | var form5 = document.getElementById("f55"); 1161 | //-->create subtititle 1162 | var subtititle = document.createElement("h3"); 1163 | subtititle.className="fs-subtitle"; 1164 | var no = parseInt(i)+1; 1165 | subtititle.id="sub"+experience_info_list_name[no-1][0]; 1166 | var hidden = document.getElementById("hidden_experience"); 1167 | hidden.innerText=(no); 1168 | subtititle.innerText="Experience "+(no); 1169 | form5.appendChild(subtititle); 1170 | for(var j=0; jcreate div in which both div of label and input will be present 1172 | var div = document.createElement("div"); 1173 | div.className="flex-container"; 1174 | form5.appendChild(div); 1175 | //-->create div of label 1176 | var labeldiv = document.createElement("div"); 1177 | labeldiv.className="labeldiv"; 1178 | labeldiv.id=experience_info_list_name[i][j]; 1179 | div.appendChild(labeldiv); 1180 | //-->create label 1181 | var label = document.createElement("label"); 1182 | label.innerText=label_names[j]; 1183 | labeldiv.appendChild(label); 1184 | //-->create input 1185 | if(j==3){ 1186 | var input = document.createElement("textarea"); 1187 | input.type="text"; 1188 | input.value=experience_info_list[i][j]; 1189 | //-->put value from list into input element 1190 | input.name=experience_info_list_name[i][j]; 1191 | div.appendChild(input); 1192 | } 1193 | else{ 1194 | var input = document.createElement("input"); 1195 | input.type="text"; 1196 | input.value=experience_info_list[i][j]; 1197 | //-->put value from list into input element 1198 | input.name=experience_info_list_name[i][j]; 1199 | div.appendChild(input); 1200 | } 1201 | 1202 | } 1203 | } 1204 | } 1205 | var form5 = document.getElementById("f55"); 1206 | //-->create div in which remove button will be present 1207 | var div = document.createElement("div"); 1208 | div.className="flex-container"; 1209 | form5.appendChild(div); 1210 | //-->create remove button 1211 | var remove_button = document.createElement("input"); 1212 | remove_button.type="button"; 1213 | remove_button.name="remove_experience"; 1214 | remove_button.className="remove"; 1215 | remove_button.onclick=removeexperience; 1216 | remove_button.value="Remove"; 1217 | remove_button.id="ex_remove"; 1218 | div.appendChild(remove_button); 1219 | //-->create add button 1220 | var add_button = document.createElement("input"); 1221 | add_button.type="button"; 1222 | add_button.name="add_experience"; 1223 | add_button.className="add"; 1224 | add_button.onclick=addexperience; 1225 | add_button.value="Add"; 1226 | add_button.id="ex_add"; 1227 | div.appendChild(add_button); 1228 | //-->create div in which both previous and next button will be present 1229 | var div = document.createElement("div"); 1230 | div.className="flex-container"; 1231 | form5.appendChild(div); 1232 | //-->create previous button 1233 | var previous_button = document.createElement("input"); 1234 | previous_button.type="button"; 1235 | previous_button.name="previous"; 1236 | previous_button.className="previous action-button"; 1237 | previous_button.onclick=clickform4; 1238 | previous_button.value="Previous"; 1239 | previous_button.id="ex_previous"; 1240 | div.appendChild(previous_button); 1241 | //-->create next button 1242 | var next_button = document.createElement("input"); 1243 | next_button.type="button"; 1244 | next_button.name="next"; 1245 | next_button.className="next action-button"; 1246 | next_button.onclick=clickform6; 1247 | next_button.value="Next"; 1248 | next_button.id="ex_next"; 1249 | div.appendChild(next_button); 1250 | list_made[4]=true; 1251 | } 1252 | } 1253 | function addexperience(){ 1254 | //-->which forms have to be visible 1255 | var form1 = document.getElementById("f1"); 1256 | form1.style.display="none"; 1257 | var form2 = document.getElementById("f2"); 1258 | form2.style.display="none"; 1259 | var form3 = document.getElementById("f3"); 1260 | form3.style.display="none"; 1261 | var form4 = document.getElementById("f4"); 1262 | form4.style.display="none"; 1263 | var form5 = document.getElementById("f5"); 1264 | form5.style.display="block"; 1265 | var form6 = document.getElementById("f6"); 1266 | form6.style.display="none"; 1267 | var form7 = document.getElementById("f7"); 1268 | form7.style.display="none"; 1269 | var form8 = document.getElementById("f8"); 1270 | form8.style.display="none"; 1271 | var form9 = document.getElementById("f9"); 1272 | form9.style.display="none"; 1273 | //-->how much of the progress bar is green 1274 | var progress = document.getElementById("p5"); 1275 | progress.classList.add("active"); 1276 | var progress = document.getElementById("p6"); 1277 | progress.classList.remove("active"); 1278 | //-->how many institutes already present 1279 | var hidden = document.getElementById("hidden_experience"); 1280 | var no = parseInt(hidden.innerText); 1281 | //-->remove buttons 1282 | var add_button = document.getElementById("ex_add"); 1283 | add_button.remove(); 1284 | var remove_button = document.getElementById("ex_remove"); 1285 | remove_button.remove(); 1286 | var previous_button = document.getElementById("ex_previous"); 1287 | previous_button.remove(); 1288 | var next_button = document.getElementById("ex_next"); 1289 | next_button.remove(); 1290 | //-->add elements 1291 | var form5 = document.getElementById("f55"); 1292 | var no = no+1; 1293 | hidden.innerText=(no); 1294 | //-->add elements in education_info_list_name 1295 | experience_info_list_name[no-1] = new Array(4) 1296 | experience_info_list_name[no-1][0] = ex_str1+no; 1297 | experience_info_list_name[no-1][1] = ex_str2+no; 1298 | experience_info_list_name[no-1][2] = ex_str3+no; 1299 | experience_info_list_name[no-1][3] = ex_str4+no; 1300 | //-->create subtititle 1301 | var subtititle = document.createElement("h3"); 1302 | subtititle.className="fs-subtitle"; 1303 | subtititle.id="sub"+experience_info_list_name[no-1][0]; 1304 | subtititle.innerText="Experience "+(no); 1305 | form5.appendChild(subtititle); 1306 | //-->add rest of the elements 1307 | var label_names = ["Company:","Role:","Duration:","Description"]; 1308 | for(var i=0; i<4; i++){ 1309 | //-->create div in which both div of label and input will be present 1310 | var div = document.createElement("div"); 1311 | div.className="flex-container"; 1312 | form5.appendChild(div); 1313 | //-->create div of label 1314 | var labeldiv = document.createElement("div"); 1315 | labeldiv.className="labeldiv"; 1316 | div.appendChild(labeldiv); 1317 | //-->create label 1318 | var label = document.createElement("label"); 1319 | label.innerText=label_names[i]; 1320 | labeldiv.id=experience_info_list_name[no-1][i]; 1321 | labeldiv.appendChild(label); 1322 | //-->create input 1323 | if(i==3){ 1324 | var input = document.createElement("textarea"); 1325 | input.type="text"; 1326 | //-->put value from list into input element 1327 | input.name=experience_info_list_name[no-1][i]; 1328 | div.appendChild(input); 1329 | } 1330 | else{ 1331 | var input = document.createElement("input"); 1332 | input.type="text"; 1333 | //-->put value from list into input element 1334 | input.name=experience_info_list_name[no-1][i]; 1335 | div.appendChild(input); 1336 | } 1337 | 1338 | } 1339 | var form5 = document.getElementById("f55"); 1340 | //-->create div in which remove button will be present 1341 | var div = document.createElement("div"); 1342 | div.className="flex-container"; 1343 | form5.appendChild(div); 1344 | //-->create remove button 1345 | var remove_button = document.createElement("input"); 1346 | remove_button.type="button"; 1347 | remove_button.name="remove_experience"; 1348 | remove_button.className="remove"; 1349 | remove_button.onclick=removeexperience; 1350 | remove_button.value="Remove"; 1351 | remove_button.id="ex_remove"; 1352 | div.appendChild(remove_button); 1353 | //-->create add button 1354 | var add_button = document.createElement("input"); 1355 | add_button.type="button"; 1356 | add_button.name="add_experience"; 1357 | add_button.className="add"; 1358 | add_button.onclick=addexperience; 1359 | add_button.value="Add"; 1360 | add_button.id="ex_add"; 1361 | div.appendChild(add_button); 1362 | //-->create div in which both previous and next button will be present 1363 | var div = document.createElement("div"); 1364 | div.className="flex-container"; 1365 | form5.appendChild(div); 1366 | //-->create previous button 1367 | var previous_button = document.createElement("input"); 1368 | previous_button.type="button"; 1369 | previous_button.name="previous"; 1370 | previous_button.className="previous action-button"; 1371 | previous_button.onclick=clickform4; 1372 | previous_button.value="Previous"; 1373 | previous_button.id="ex_previous"; 1374 | div.appendChild(previous_button); 1375 | //-->create next button 1376 | var next_button = document.createElement("input"); 1377 | next_button.type="button"; 1378 | next_button.name="next"; 1379 | next_button.className="next action-button"; 1380 | next_button.onclick=clickform6; 1381 | next_button.value="Next"; 1382 | next_button.id="ex_next"; 1383 | div.appendChild(next_button); 1384 | } 1385 | function removeexperience(){ 1386 | //-->which forms have to be visible 1387 | var form1 = document.getElementById("f1"); 1388 | form1.style.display="none"; 1389 | var form2 = document.getElementById("f2"); 1390 | form2.style.display="none"; 1391 | var form3 = document.getElementById("f3"); 1392 | form3.style.display="none"; 1393 | var form4 = document.getElementById("f4"); 1394 | form4.style.display="none"; 1395 | var form5 = document.getElementById("f5"); 1396 | form5.style.display="block"; 1397 | var form6 = document.getElementById("f6"); 1398 | form6.style.display="none"; 1399 | var form7 = document.getElementById("f7"); 1400 | form7.style.display="none"; 1401 | var form8 = document.getElementById("f8"); 1402 | form8.style.display="none"; 1403 | var form9 = document.getElementById("f9"); 1404 | form9.style.display="none"; 1405 | //-->how much of the progress bar is green 1406 | var progress = document.getElementById("p5"); 1407 | progress.classList.add("active"); 1408 | var progress = document.getElementById("p6"); 1409 | progress.classList.remove("active"); 1410 | //-->how many institutes already present 1411 | var hidden = document.getElementById("hidden_experience"); 1412 | var no = parseInt(hidden.innerText); 1413 | //-->remove most current subtitle 1414 | var subtititle = document.getElementById("sub"+experience_info_list_name[no-1][0]); 1415 | subtititle.remove(); 1416 | //-->remove most current labels and textfields 1417 | for(var i=0; i<4; i++){ 1418 | //-->remove text fields 1419 | var text = document.getElementsByName(experience_info_list_name[no-1][i]); 1420 | text[0].remove(); 1421 | //-->remove labels 1422 | var label = document.getElementById(experience_info_list_name[no-1][i]); 1423 | label.remove(); 1424 | } 1425 | //-->update projects_info_list_name 1426 | for(var i=3; i>=0; i--){ 1427 | experience_info_list_name[no-1].splice(i,1); 1428 | } 1429 | experience_info_list_name.splice((no-1),1); 1430 | hidden.innerText=(no-1); 1431 | 1432 | } 1433 | //-->Function to go from form5 -> form6 or from form7 -> form6 1434 | function clickform6(){ 1435 | //-->which forms have to be visible 1436 | var form1 = document.getElementById("f1"); 1437 | form1.style.display="none"; 1438 | var form2 = document.getElementById("f2"); 1439 | form2.style.display="none"; 1440 | var form3 = document.getElementById("f3"); 1441 | form3.style.display="none"; 1442 | var form4 = document.getElementById("f4"); 1443 | form4.style.display="none"; 1444 | var form5 = document.getElementById("f5"); 1445 | form5.style.display="none"; 1446 | var form6 = document.getElementById("f6"); 1447 | form6.style.display="block"; 1448 | var form7 = document.getElementById("f7"); 1449 | form7.style.display="none"; 1450 | var form8 = document.getElementById("f8"); 1451 | form8.style.display="none"; 1452 | var form9 = document.getElementById("f9"); 1453 | form9.style.display="none"; 1454 | //-->how much of the progress bar is green 1455 | var progress = document.getElementById("p6"); 1456 | progress.classList.add("active"); 1457 | var progress = document.getElementById("p7"); 1458 | progress.classList.remove("active"); 1459 | if(list_made[5]==false){ 1460 | var lennotzero=true; 1461 | //-->declare list to be used in this form 1462 | var skills_info_list=[]; 1463 | //-->fill the list from main string 1464 | for (var i in json_string){ 1465 | if(i=="skills_info_list"){ 1466 | if(json_string[i].length>0){ 1467 | for(var j=0; jadd new list to the certifications_info_list 1469 | skills_info_list[j] = json_string[i][j]; 1470 | } 1471 | } 1472 | else{ 1473 | lennotzero = false; 1474 | } 1475 | } 1476 | 1477 | } 1478 | //console.log(skills_info_list); 1479 | if(lennotzero){ 1480 | //-->declare list holding names of of the elements 1481 | var count=1; 1482 | //-->dynamically change each name depeneding on list index 1483 | for(var i in skills_info_list){ 1484 | skills_info_list_name[i] = sk_str1+count; 1485 | count+=1; 1486 | } 1487 | //console.log(skills_info_list_name); 1488 | //-->creating elements 1489 | for(var i in skills_info_list){ 1490 | var form6 = document.getElementById("f66"); 1491 | //-->create div in which both div of label and input will be present 1492 | var div = document.createElement("div"); 1493 | div.className="flex-container"; 1494 | form6.appendChild(div); 1495 | //-->create div of label 1496 | var labeldiv = document.createElement("div"); 1497 | labeldiv.className="labeldiv"; 1498 | labeldiv.id=skills_info_list_name[i]; 1499 | div.appendChild(labeldiv); 1500 | //-->create label 1501 | var label = document.createElement("label"); 1502 | var j=parseInt(i)+1; 1503 | label.innerText="Skill "+(j)+":"; 1504 | labeldiv.appendChild(label); 1505 | //-->create input 1506 | var input = document.createElement("input"); 1507 | input.type="text"; 1508 | input.value=skills_info_list[i]; 1509 | //-->put value from list into input element 1510 | input.name=skills_info_list_name[i]; 1511 | div.appendChild(input); 1512 | } 1513 | } 1514 | //-->update hidden value 1515 | var no = skills_info_list.length; 1516 | var hidden = document.getElementById("hidden_skils"); 1517 | hidden.innerText=(no); 1518 | var form6 = document.getElementById("f66"); 1519 | //-->create div in which remove button will be present 1520 | var div = document.createElement("div"); 1521 | div.className="flex-container"; 1522 | form6.appendChild(div); 1523 | //-->create remove button 1524 | var remove_button = document.createElement("input"); 1525 | remove_button.type="button"; 1526 | remove_button.name="remove_skill"; 1527 | remove_button.className="remove"; 1528 | remove_button.onclick=removeskill; 1529 | remove_button.value="Remove"; 1530 | remove_button.id="sk_remove"; 1531 | div.appendChild(remove_button); 1532 | //-->create add button 1533 | var add_button = document.createElement("input"); 1534 | add_button.type="button"; 1535 | add_button.name="add_skill"; 1536 | add_button.className="add"; 1537 | add_button.onclick=addskill; 1538 | add_button.value="Add"; 1539 | add_button.id="sk_add"; 1540 | div.appendChild(add_button); 1541 | //-->create div in which both previous and next button will be present 1542 | var div = document.createElement("div"); 1543 | div.className="flex-container"; 1544 | form6.appendChild(div); 1545 | //-->create previous button 1546 | var previous_button = document.createElement("input"); 1547 | previous_button.type="button"; 1548 | previous_button.name="previous"; 1549 | previous_button.className="previous action-button"; 1550 | previous_button.onclick=clickform5; 1551 | previous_button.value="Previous"; 1552 | previous_button.id="sk_previous"; 1553 | div.appendChild(previous_button); 1554 | //-->create next button 1555 | var next_button = document.createElement("input"); 1556 | next_button.type="button"; 1557 | next_button.name="next"; 1558 | next_button.className="next action-button"; 1559 | next_button.onclick=clickform7; 1560 | next_button.value="Next"; 1561 | next_button.id="sk_next"; 1562 | div.appendChild(next_button); 1563 | list_made[5]=true; 1564 | } 1565 | } 1566 | function addskill(){ 1567 | //-->which forms have to be visible 1568 | var form1 = document.getElementById("f1"); 1569 | form1.style.display="none"; 1570 | var form2 = document.getElementById("f2"); 1571 | form2.style.display="none"; 1572 | var form3 = document.getElementById("f3"); 1573 | form3.style.display="none"; 1574 | var form4 = document.getElementById("f4"); 1575 | form4.style.display="none"; 1576 | var form5 = document.getElementById("f5"); 1577 | form5.style.display="none"; 1578 | var form6 = document.getElementById("f6"); 1579 | form6.style.display="block"; 1580 | var form7 = document.getElementById("f7"); 1581 | form7.style.display="none"; 1582 | var form8 = document.getElementById("f8"); 1583 | form8.style.display="none"; 1584 | var form9 = document.getElementById("f9"); 1585 | form9.style.display="none"; 1586 | //-->how much of the progress bar is green 1587 | var progress = document.getElementById("p6"); 1588 | progress.classList.add("active"); 1589 | var progress = document.getElementById("p7"); 1590 | progress.classList.remove("active"); 1591 | //-->how many institutes already present 1592 | var hidden = document.getElementById("hidden_skils"); 1593 | var no = parseInt(hidden.innerText); 1594 | //-->remove buttons 1595 | var add_button = document.getElementById("sk_add"); 1596 | add_button.remove(); 1597 | var remove_button = document.getElementById("sk_remove"); 1598 | remove_button.remove(); 1599 | var previous_button = document.getElementById("sk_previous"); 1600 | previous_button.remove(); 1601 | var next_button = document.getElementById("sk_next"); 1602 | next_button.remove(); 1603 | //-->add elements 1604 | var form6 = document.getElementById("f66"); 1605 | var no = no+1; 1606 | hidden.innerText=(no); 1607 | //-->add elements in education_info_list_name 1608 | skills_info_list_name[no-1] = sk_str1+no; 1609 | var form6 = document.getElementById("f66"); 1610 | //-->create div in which both div of label and input will be present 1611 | var div = document.createElement("div"); 1612 | div.className="flex-container"; 1613 | form6.appendChild(div); 1614 | //-->create div of label 1615 | var labeldiv = document.createElement("div"); 1616 | labeldiv.className="labeldiv"; 1617 | labeldiv.id=skills_info_list_name[no-1]; 1618 | div.appendChild(labeldiv); 1619 | //-->create label 1620 | var label = document.createElement("label"); 1621 | label.innerText="Skill "+(no)+":"; 1622 | labeldiv.appendChild(label); 1623 | //-->create input 1624 | var input = document.createElement("input"); 1625 | input.type="text"; 1626 | //-->put value from list into input element 1627 | input.name=skills_info_list_name[no-1]; 1628 | div.appendChild(input); 1629 | var form6 = document.getElementById("f66"); 1630 | //-->create div in which remove button will be present 1631 | var div = document.createElement("div"); 1632 | div.className="flex-container"; 1633 | form6.appendChild(div); 1634 | //-->create remove button 1635 | var remove_button = document.createElement("input"); 1636 | remove_button.type="button"; 1637 | remove_button.name="remove_skill"; 1638 | remove_button.className="remove"; 1639 | remove_button.onclick=removeskill; 1640 | remove_button.value="Remove"; 1641 | remove_button.id="sk_remove"; 1642 | div.appendChild(remove_button); 1643 | //-->create add button 1644 | var add_button = document.createElement("input"); 1645 | add_button.type="button"; 1646 | add_button.name="add_skill"; 1647 | add_button.className="add"; 1648 | add_button.onclick=addskill; 1649 | add_button.value="Add"; 1650 | add_button.id="sk_add"; 1651 | div.appendChild(add_button); 1652 | //-->create div in which both previous and next button will be present 1653 | var div = document.createElement("div"); 1654 | div.className="flex-container"; 1655 | form6.appendChild(div); 1656 | //-->create previous button 1657 | var previous_button = document.createElement("input"); 1658 | previous_button.type="button"; 1659 | previous_button.name="previous"; 1660 | previous_button.className="previous action-button"; 1661 | previous_button.onclick=clickform5; 1662 | previous_button.value="Previous"; 1663 | previous_button.id="sk_previous"; 1664 | div.appendChild(previous_button); 1665 | //-->create next button 1666 | var next_button = document.createElement("input"); 1667 | next_button.type="button"; 1668 | next_button.name="next"; 1669 | next_button.className="next action-button"; 1670 | next_button.onclick=clickform7; 1671 | next_button.value="Next"; 1672 | next_button.id="sk_next"; 1673 | div.appendChild(next_button); 1674 | } 1675 | function removeskill(){ 1676 | //-->which forms have to be visible 1677 | var form1 = document.getElementById("f1"); 1678 | form1.style.display="none"; 1679 | var form2 = document.getElementById("f2"); 1680 | form2.style.display="none"; 1681 | var form3 = document.getElementById("f3"); 1682 | form3.style.display="none"; 1683 | var form4 = document.getElementById("f4"); 1684 | form4.style.display="none"; 1685 | var form5 = document.getElementById("f5"); 1686 | form5.style.display="none"; 1687 | var form6 = document.getElementById("f6"); 1688 | form6.style.display="block"; 1689 | var form7 = document.getElementById("f7"); 1690 | form7.style.display="none"; 1691 | var form8 = document.getElementById("f8"); 1692 | form8.style.display="none"; 1693 | var form9 = document.getElementById("f9"); 1694 | form9.style.display="none"; 1695 | //-->how much of the progress bar is green 1696 | var progress = document.getElementById("p6"); 1697 | progress.classList.add("active"); 1698 | var progress = document.getElementById("p7"); 1699 | progress.classList.remove("active"); 1700 | //-->how many institutes already present 1701 | var hidden = document.getElementById("hidden_skils"); 1702 | var no = parseInt(hidden.innerText); 1703 | //-->remove text fields 1704 | var text = document.getElementsByName(skills_info_list_name[no-1]); 1705 | text[0].remove(); 1706 | //-->remove labels 1707 | var label = document.getElementById(skills_info_list_name[no-1]); 1708 | label.remove(); 1709 | skills_info_list_name.splice((no-1),1); 1710 | hidden.innerText=(no-1); 1711 | } 1712 | //-->Function to go from form6 -> form7 or from form8 -> form7 1713 | function clickform7(){ 1714 | //-->which forms have to be visible 1715 | var form1 = document.getElementById("f1"); 1716 | form1.style.display="none"; 1717 | var form2 = document.getElementById("f2"); 1718 | form2.style.display="none"; 1719 | var form3 = document.getElementById("f3"); 1720 | form3.style.display="none"; 1721 | var form4 = document.getElementById("f4"); 1722 | form4.style.display="none"; 1723 | var form5 = document.getElementById("f5"); 1724 | form5.style.display="none"; 1725 | var form6 = document.getElementById("f6"); 1726 | form6.style.display="none"; 1727 | var form7 = document.getElementById("f7"); 1728 | form7.style.display="block"; 1729 | var form8 = document.getElementById("f8"); 1730 | form8.style.display="none"; 1731 | var form9 = document.getElementById("f9"); 1732 | form9.style.display="none"; 1733 | //-->how much of the progress bar is green 1734 | var progress = document.getElementById("p7"); 1735 | progress.classList.add("active"); 1736 | var progress = document.getElementById("p8"); 1737 | progress.classList.remove("active"); 1738 | if(list_made[6]==false){ 1739 | var lennotzero=true; 1740 | //-->declare list to be used in this form 1741 | var volunteer_info_list=[]; 1742 | //-->fill the list from main string 1743 | for (var i in json_string){ 1744 | if(i=="volunteer_info_list"){ 1745 | if(json_string[i].length>0){ 1746 | for(var j=0; jadd new list to the certifications_info_list 1748 | volunteer_info_list[j] = new Array(json_string[i][j].length); 1749 | for(var k=0; kdeclare list holding names of of the elements 1763 | var count=1; 1764 | //-->dynamically change each name depeneding on list index 1765 | for(var i in volunteer_info_list){ 1766 | volunteer_info_list_name[i] = new Array(volunteer_info_list[i].length) 1767 | volunteer_info_list_name[i][0] = vo_str1+count; 1768 | volunteer_info_list_name[i][1] = vo_str2+count; 1769 | volunteer_info_list_name[i][2] = vo_str3+count; 1770 | volunteer_info_list_name[i][3] = vo_str4+count; 1771 | count+=1; 1772 | } 1773 | var len_sublist = volunteer_info_list[i].length; 1774 | var label_names = ["Company:","Role:","Duration:","Description"]; 1775 | //console.log(experience_info_list_name); 1776 | //-->creating elements 1777 | for(var i in volunteer_info_list){ 1778 | var form7 = document.getElementById("f77"); 1779 | //-->create subtititle 1780 | var subtititle = document.createElement("h3"); 1781 | subtititle.className="fs-subtitle"; 1782 | var no = parseInt(i)+1; 1783 | subtititle.id="sub"+volunteer_info_list[no-1][0]; 1784 | var hidden = document.getElementById("hidden_volunteer"); 1785 | hidden.innerText=(no); 1786 | subtititle.innerText="Volunteer Experience "+(no); 1787 | form7.appendChild(subtititle); 1788 | for(var j=0; jcreate div in which both div of label and input will be present 1790 | var div = document.createElement("div"); 1791 | div.className="flex-container"; 1792 | form7.appendChild(div); 1793 | //-->create div of label 1794 | var labeldiv = document.createElement("div"); 1795 | labeldiv.className="labeldiv"; 1796 | labeldiv.id=volunteer_info_list_name[i][j]; 1797 | div.appendChild(labeldiv); 1798 | //-->create label 1799 | var label = document.createElement("label"); 1800 | label.innerText=label_names[j]; 1801 | labeldiv.appendChild(label); 1802 | //-->create input 1803 | if(j==3){ 1804 | var input = document.createElement("textarea"); 1805 | input.type="text"; 1806 | input.value=volunteer_info_list[i][j]; 1807 | //-->put value from list into input element 1808 | input.name=volunteer_info_list_name[i][j]; 1809 | div.appendChild(input); 1810 | } 1811 | else{ 1812 | var input = document.createElement("input"); 1813 | input.type="text"; 1814 | input.value=volunteer_info_list[i][j]; 1815 | //-->put value from list into input element 1816 | input.name=volunteer_info_list_name[i][j]; 1817 | div.appendChild(input); 1818 | } 1819 | 1820 | } 1821 | } 1822 | } 1823 | var form7 = document.getElementById("f77"); 1824 | //-->create div in which remove button will be present 1825 | var div = document.createElement("div"); 1826 | div.className="flex-container"; 1827 | form7.appendChild(div); 1828 | //-->create remove button 1829 | var remove_button = document.createElement("input"); 1830 | remove_button.type="button"; 1831 | remove_button.name="remove_volunteer"; 1832 | remove_button.className="remove"; 1833 | remove_button.onclick=removevolunteer; 1834 | remove_button.value="Remove"; 1835 | remove_button.id="vo_remove"; 1836 | div.appendChild(remove_button); 1837 | //-->create add button 1838 | var add_button = document.createElement("input"); 1839 | add_button.type="button"; 1840 | add_button.name="add_volunteer"; 1841 | add_button.className="add"; 1842 | add_button.onclick=addvolunteer; 1843 | add_button.value="Add"; 1844 | add_button.id="vo_add"; 1845 | div.appendChild(add_button); 1846 | //-->create div in which both previous and next button will be present 1847 | var div = document.createElement("div"); 1848 | div.className="flex-container"; 1849 | form7.appendChild(div); 1850 | //-->create previous button 1851 | var previous_button = document.createElement("input"); 1852 | previous_button.type="button"; 1853 | previous_button.name="previous"; 1854 | previous_button.className="previous action-button"; 1855 | previous_button.onclick=clickform6; 1856 | previous_button.value="Previous"; 1857 | previous_button.id="vo_previous"; 1858 | div.appendChild(previous_button); 1859 | //-->create next button 1860 | var next_button = document.createElement("input"); 1861 | next_button.type="button"; 1862 | next_button.name="next"; 1863 | next_button.className="next action-button"; 1864 | next_button.onclick=clickform8; 1865 | next_button.value="Next"; 1866 | next_button.id="vo_next"; 1867 | div.appendChild(next_button); 1868 | list_made[6]=true; 1869 | } 1870 | } 1871 | function addvolunteer(){ 1872 | //-->which forms have to be visible 1873 | var form1 = document.getElementById("f1"); 1874 | form1.style.display="none"; 1875 | var form2 = document.getElementById("f2"); 1876 | form2.style.display="none"; 1877 | var form3 = document.getElementById("f3"); 1878 | form3.style.display="none"; 1879 | var form4 = document.getElementById("f4"); 1880 | form4.style.display="none"; 1881 | var form5 = document.getElementById("f5"); 1882 | form5.style.display="none"; 1883 | var form6 = document.getElementById("f6"); 1884 | form6.style.display="none"; 1885 | var form7 = document.getElementById("f7"); 1886 | form7.style.display="block"; 1887 | var form8 = document.getElementById("f8"); 1888 | form8.style.display="none"; 1889 | var form9 = document.getElementById("f9"); 1890 | form9.style.display="none"; 1891 | //-->how much of the progress bar is green 1892 | var progress = document.getElementById("p7"); 1893 | progress.classList.add("active"); 1894 | var progress = document.getElementById("p8"); 1895 | progress.classList.remove("active"); 1896 | //-->how many institutes already present 1897 | var hidden = document.getElementById("hidden_volunteer"); 1898 | var no = parseInt(hidden.innerText); 1899 | //-->remove buttons 1900 | var add_button = document.getElementById("vo_add"); 1901 | add_button.remove(); 1902 | var remove_button = document.getElementById("vo_remove"); 1903 | remove_button.remove(); 1904 | var previous_button = document.getElementById("vo_previous"); 1905 | previous_button.remove(); 1906 | var next_button = document.getElementById("vo_next"); 1907 | next_button.remove(); 1908 | //-->add elements 1909 | var form7 = document.getElementById("f77"); 1910 | var no = no+1; 1911 | hidden.innerText=(no); 1912 | //-->add elements in education_info_list_name 1913 | volunteer_info_list_name[no-1] = new Array(4) 1914 | volunteer_info_list_name[no-1][0] = vo_str1+no; 1915 | volunteer_info_list_name[no-1][1] = vo_str2+no; 1916 | volunteer_info_list_name[no-1][2] = vo_str3+no; 1917 | volunteer_info_list_name[no-1][3] = vo_str4+no; 1918 | //-->create subtititle 1919 | var subtititle = document.createElement("h3"); 1920 | subtititle.className="fs-subtitle"; 1921 | subtititle.id="sub"+volunteer_info_list_name[no-1][0]; 1922 | subtititle.innerText="Volunteer Experience "+(no); 1923 | form7.appendChild(subtititle); 1924 | //-->add rest of the elements 1925 | var label_names = ["Company:","Role:","Duration:","Description"]; 1926 | for(var i=0; i<4; i++){ 1927 | //-->create div in which both div of label and input will be present 1928 | var div = document.createElement("div"); 1929 | div.className="flex-container"; 1930 | form7.appendChild(div); 1931 | //-->create div of label 1932 | var labeldiv = document.createElement("div"); 1933 | labeldiv.className="labeldiv"; 1934 | div.appendChild(labeldiv); 1935 | //-->create label 1936 | var label = document.createElement("label"); 1937 | label.innerText=label_names[i]; 1938 | labeldiv.id=volunteer_info_list_name[no-1][i]; 1939 | labeldiv.appendChild(label); 1940 | //-->create input 1941 | if(i==3){ 1942 | var input = document.createElement("textarea"); 1943 | input.type="text"; 1944 | input.name=volunteer_info_list_name[no-1][i]; 1945 | div.appendChild(input); 1946 | } 1947 | else{ 1948 | var input = document.createElement("input"); 1949 | input.type="text"; 1950 | input.name=volunteer_info_list_name[no-1][i]; 1951 | div.appendChild(input); 1952 | } 1953 | 1954 | } 1955 | var form7 = document.getElementById("f77"); 1956 | //-->create div in which remove button will be present 1957 | var div = document.createElement("div"); 1958 | div.className="flex-container"; 1959 | form7.appendChild(div); 1960 | //-->create remove button 1961 | var remove_button = document.createElement("input"); 1962 | remove_button.type="button"; 1963 | remove_button.name="remove_volunteer"; 1964 | remove_button.className="remove"; 1965 | remove_button.onclick=removevolunteer; 1966 | remove_button.value="Remove"; 1967 | remove_button.id="vo_remove"; 1968 | div.appendChild(remove_button); 1969 | //-->create add button 1970 | var add_button = document.createElement("input"); 1971 | add_button.type="button"; 1972 | add_button.name="add_volunteer"; 1973 | add_button.className="add"; 1974 | add_button.onclick=addvolunteer; 1975 | add_button.value="Add"; 1976 | add_button.id="vo_add"; 1977 | div.appendChild(add_button); 1978 | //-->create div in which both previous and next button will be present 1979 | var div = document.createElement("div"); 1980 | div.className="flex-container"; 1981 | form7.appendChild(div); 1982 | //-->create previous button 1983 | var previous_button = document.createElement("input"); 1984 | previous_button.type="button"; 1985 | previous_button.name="previous"; 1986 | previous_button.className="previous action-button"; 1987 | previous_button.onclick=clickform6; 1988 | previous_button.value="Previous"; 1989 | previous_button.id="vo_previous"; 1990 | div.appendChild(previous_button); 1991 | //-->create next button 1992 | var next_button = document.createElement("input"); 1993 | next_button.type="button"; 1994 | next_button.name="next"; 1995 | next_button.className="next action-button"; 1996 | next_button.onclick=clickform8; 1997 | next_button.value="Next"; 1998 | next_button.id="vo_next"; 1999 | div.appendChild(next_button); 2000 | } 2001 | function removevolunteer(){ 2002 | //-->which forms have to be visible 2003 | var form1 = document.getElementById("f1"); 2004 | form1.style.display="none"; 2005 | var form2 = document.getElementById("f2"); 2006 | form2.style.display="none"; 2007 | var form3 = document.getElementById("f3"); 2008 | form3.style.display="none"; 2009 | var form4 = document.getElementById("f4"); 2010 | form4.style.display="none"; 2011 | var form5 = document.getElementById("f5"); 2012 | form5.style.display="none"; 2013 | var form6 = document.getElementById("f6"); 2014 | form6.style.display="none"; 2015 | var form7 = document.getElementById("f7"); 2016 | form7.style.display="block"; 2017 | var form8 = document.getElementById("f8"); 2018 | form8.style.display="none"; 2019 | var form9 = document.getElementById("f9"); 2020 | form9.style.display="none"; 2021 | //-->how much of the progress bar is green 2022 | var progress = document.getElementById("p7"); 2023 | progress.classList.add("active"); 2024 | var progress = document.getElementById("p8"); 2025 | progress.classList.remove("active"); 2026 | //-->how many institutes already present 2027 | var hidden = document.getElementById("hidden_volunteer"); 2028 | var no = parseInt(hidden.innerText); 2029 | //-->remove most current subtitle 2030 | var subtititle = document.getElementById("sub"+volunteer_info_list_name[no-1][0]); 2031 | subtititle.remove(); 2032 | //-->remove most current labels and textfields 2033 | for(var i=0; i<4; i++){ 2034 | //-->remove text fields 2035 | var text = document.getElementsByName(volunteer_info_list_name[no-1][i]); 2036 | text[0].remove(); 2037 | //-->remove labels 2038 | var label = document.getElementById(volunteer_info_list_name[no-1][i]); 2039 | label.remove(); 2040 | } 2041 | //-->update projects_info_list_name 2042 | for(var i=3; i>=0; i--){ 2043 | volunteer_info_list_name[no-1].splice(i,1); 2044 | } 2045 | volunteer_info_list_name.splice((no-1),1); 2046 | hidden.innerText=(no-1); 2047 | } 2048 | //-->Function to go from form7 -> form8 or from form9 -> form8 2049 | function clickform8(){ 2050 | //-->which forms have to be visible 2051 | var form1 = document.getElementById("f1"); 2052 | form1.style.display="none"; 2053 | var form2 = document.getElementById("f2"); 2054 | form2.style.display="none"; 2055 | var form3 = document.getElementById("f3"); 2056 | form3.style.display="none"; 2057 | var form4 = document.getElementById("f4"); 2058 | form4.style.display="none"; 2059 | var form5 = document.getElementById("f5"); 2060 | form5.style.display="none"; 2061 | var form6 = document.getElementById("f6"); 2062 | form6.style.display="none"; 2063 | var form7 = document.getElementById("f7"); 2064 | form7.style.display="none"; 2065 | var form8 = document.getElementById("f8"); 2066 | form8.style.display="block"; 2067 | var form9 = document.getElementById("f9"); 2068 | form9.style.display="none"; 2069 | //-->how much of the progress bar is green 2070 | var progress = document.getElementById("p8"); 2071 | progress.classList.add("active"); 2072 | var progress = document.getElementById("p9"); 2073 | progress.classList.remove("active"); 2074 | if(list_made[7]==false){ 2075 | var lennotzero=true; 2076 | //-->declare list to be used in this form 2077 | var accomplishments_info_list=[]; 2078 | //-->fill the list from main string 2079 | for (var i in json_string){ 2080 | if(i=="accomplishments_info_list"){ 2081 | if(json_string[i].length>0){ 2082 | for(var j=0; jadd new list to the certifications_info_list 2084 | accomplishments_info_list[j] = new Array(json_string[i][j].length); 2085 | for(var k=0; kdeclare list holding names of of the elements 2099 | var count=1; 2100 | //-->dynamically change each name depeneding on list index 2101 | for(var i in accomplishments_info_list){ 2102 | accomplishments_info_list_name[i] = new Array(accomplishments_info_list[i].length) 2103 | accomplishments_info_list_name[i][0] = ac_str1+count; 2104 | accomplishments_info_list_name[i][1] = ac_str2+count; 2105 | count+=1; 2106 | } 2107 | var len_sublist = accomplishments_info_list[i].length; 2108 | var label_names = ["Name:","Year:"]; 2109 | //console.log(accomplishments_info_list_name); 2110 | //-->creating elements 2111 | for(var i in accomplishments_info_list){ 2112 | var form8 = document.getElementById("f88"); 2113 | //-->create subtititle 2114 | var subtititle = document.createElement("h3"); 2115 | subtititle.className="fs-subtitle"; 2116 | var no = parseInt(i)+1; 2117 | subtititle.id="sub"+accomplishments_info_list[no-1][0]; 2118 | var hidden = document.getElementById("hidden_accomplishments"); 2119 | hidden.innerText=(no); 2120 | subtititle.innerText="Accomplishment "+(no); 2121 | form8.appendChild(subtititle); 2122 | for(var j=0; jcreate div in which both div of label and input will be present 2124 | var div = document.createElement("div"); 2125 | div.className="flex-container"; 2126 | form8.appendChild(div); 2127 | //-->create div of label 2128 | var labeldiv = document.createElement("div"); 2129 | labeldiv.className="labeldiv"; 2130 | labeldiv.id=accomplishments_info_list_name[i][j]; 2131 | div.appendChild(labeldiv); 2132 | //-->create label 2133 | var label = document.createElement("label"); 2134 | label.innerText=label_names[j]; 2135 | labeldiv.appendChild(label); 2136 | //-->create input 2137 | var input = document.createElement("input"); 2138 | input.type="text"; 2139 | input.value=accomplishments_info_list[i][j]; 2140 | //-->put value from list into input element 2141 | input.name=accomplishments_info_list_name[i][j]; 2142 | div.appendChild(input); 2143 | } 2144 | } 2145 | } 2146 | var form8 = document.getElementById("f88"); 2147 | //-->create div in which remove button will be present 2148 | var div = document.createElement("div"); 2149 | div.className="flex-container"; 2150 | form8.appendChild(div); 2151 | //-->create remove button 2152 | var remove_button = document.createElement("input"); 2153 | remove_button.type="button"; 2154 | remove_button.name="remove_accomplishment"; 2155 | remove_button.className="remove"; 2156 | remove_button.onclick=removeaccomplishment; 2157 | remove_button.value="Remove"; 2158 | remove_button.id="ac_remove"; 2159 | div.appendChild(remove_button); 2160 | //-->create add button 2161 | var add_button = document.createElement("input"); 2162 | add_button.type="button"; 2163 | add_button.name="add_accpmplishment"; 2164 | add_button.className="add"; 2165 | add_button.onclick=addaccomplishment; 2166 | add_button.value="Add"; 2167 | add_button.id="ac_add"; 2168 | div.appendChild(add_button); 2169 | //-->create div in which both previous and next button will be present 2170 | var div = document.createElement("div"); 2171 | div.className="flex-container"; 2172 | form8.appendChild(div); 2173 | //-->create previous button 2174 | var previous_button = document.createElement("input"); 2175 | previous_button.type="button"; 2176 | previous_button.name="previous"; 2177 | previous_button.className="previous action-button"; 2178 | previous_button.onclick=clickform7; 2179 | previous_button.value="Previous"; 2180 | previous_button.id="ac_previous"; 2181 | div.appendChild(previous_button); 2182 | //-->create next button 2183 | var next_button = document.createElement("input"); 2184 | next_button.type="button"; 2185 | next_button.name="next"; 2186 | next_button.className="next action-button"; 2187 | next_button.onclick=clickform9; 2188 | next_button.value="Next"; 2189 | next_button.id="ac_next"; 2190 | div.appendChild(next_button); 2191 | list_made[7]=true; 2192 | } 2193 | } 2194 | function addaccomplishment(){ 2195 | //-->which forms have to be visible 2196 | var form1 = document.getElementById("f1"); 2197 | form1.style.display="none"; 2198 | var form2 = document.getElementById("f2"); 2199 | form2.style.display="none"; 2200 | var form3 = document.getElementById("f3"); 2201 | form3.style.display="none"; 2202 | var form4 = document.getElementById("f4"); 2203 | form4.style.display="none"; 2204 | var form5 = document.getElementById("f5"); 2205 | form5.style.display="none"; 2206 | var form6 = document.getElementById("f6"); 2207 | form6.style.display="none"; 2208 | var form7 = document.getElementById("f7"); 2209 | form7.style.display="none"; 2210 | var form8 = document.getElementById("f8"); 2211 | form8.style.display="block"; 2212 | var form9 = document.getElementById("f9"); 2213 | form9.style.display="none"; 2214 | //-->how much of the progress bar is green 2215 | var progress = document.getElementById("p8"); 2216 | progress.classList.add("active"); 2217 | var progress = document.getElementById("p9"); 2218 | progress.classList.remove("active"); 2219 | //-->how many institutes already present 2220 | var hidden = document.getElementById("hidden_accomplishments"); 2221 | var no = parseInt(hidden.innerText); 2222 | //-->remove buttons 2223 | var add_button = document.getElementById("ac_add"); 2224 | add_button.remove(); 2225 | var remove_button = document.getElementById("ac_remove"); 2226 | remove_button.remove(); 2227 | var previous_button = document.getElementById("ac_previous"); 2228 | previous_button.remove(); 2229 | var next_button = document.getElementById("ac_next"); 2230 | next_button.remove(); 2231 | //-->add elements 2232 | var form8 = document.getElementById("f88"); 2233 | var no = no+1; 2234 | hidden.innerText=(no); 2235 | //-->add elements in education_info_list_name 2236 | accomplishments_info_list_name[no-1] = new Array(2) 2237 | accomplishments_info_list_name[no-1][0] = ac_str1+no; 2238 | accomplishments_info_list_name[no-1][1] = ac_str2+no; 2239 | //-->create subtititle 2240 | var subtititle = document.createElement("h3"); 2241 | subtititle.className="fs-subtitle"; 2242 | subtititle.id="sub"+accomplishments_info_list_name[no-1][0]; 2243 | subtititle.innerText="Accomplishment "+(no); 2244 | form8.appendChild(subtititle); 2245 | //-->add rest of the elements 2246 | var label_names = ["Name:","Year:"]; 2247 | for(var i=0; i<2; i++){ 2248 | //-->create div in which both div of label and input will be present 2249 | var div = document.createElement("div"); 2250 | div.className="flex-container"; 2251 | form8.appendChild(div); 2252 | //-->create div of label 2253 | var labeldiv = document.createElement("div"); 2254 | labeldiv.className="labeldiv"; 2255 | div.appendChild(labeldiv); 2256 | //-->create label 2257 | var label = document.createElement("label"); 2258 | label.innerText=label_names[i]; 2259 | labeldiv.id=accomplishments_info_list_name[no-1][i]; 2260 | labeldiv.appendChild(label); 2261 | //-->create input 2262 | var input = document.createElement("input"); 2263 | input.type="text"; 2264 | input.name=accomplishments_info_list_name[no-1][i]; 2265 | div.appendChild(input); 2266 | } 2267 | var form8 = document.getElementById("f88"); 2268 | //-->create div in which remove button will be present 2269 | var div = document.createElement("div"); 2270 | div.className="flex-container"; 2271 | form8.appendChild(div); 2272 | //-->create remove button 2273 | var remove_button = document.createElement("input"); 2274 | remove_button.type="button"; 2275 | remove_button.name="remove_accomplishment"; 2276 | remove_button.className="remove"; 2277 | remove_button.onclick=removeaccomplishment; 2278 | remove_button.value="Remove"; 2279 | remove_button.id="ac_remove"; 2280 | div.appendChild(remove_button); 2281 | //-->create add button 2282 | var add_button = document.createElement("input"); 2283 | add_button.type="button"; 2284 | add_button.name="add_accpmplishment"; 2285 | add_button.className="add"; 2286 | add_button.onclick=addaccomplishment; 2287 | add_button.value="Add"; 2288 | add_button.id="ac_add"; 2289 | div.appendChild(add_button); 2290 | //-->create div in which both previous and next button will be present 2291 | var div = document.createElement("div"); 2292 | div.className="flex-container"; 2293 | form8.appendChild(div); 2294 | //-->create previous button 2295 | var previous_button = document.createElement("input"); 2296 | previous_button.type="button"; 2297 | previous_button.name="previous"; 2298 | previous_button.className="previous action-button"; 2299 | previous_button.onclick=clickform7; 2300 | previous_button.value="Previous"; 2301 | previous_button.id="ac_previous"; 2302 | div.appendChild(previous_button); 2303 | //-->create next button 2304 | var next_button = document.createElement("input"); 2305 | next_button.type="button"; 2306 | next_button.name="next"; 2307 | next_button.className="next action-button"; 2308 | next_button.onclick=clickform9; 2309 | next_button.value="Next"; 2310 | next_button.id="ac_next"; 2311 | div.appendChild(next_button); 2312 | } 2313 | function removeaccomplishment(){ 2314 | //-->which forms have to be visible 2315 | var form1 = document.getElementById("f1"); 2316 | form1.style.display="none"; 2317 | var form2 = document.getElementById("f2"); 2318 | form2.style.display="none"; 2319 | var form3 = document.getElementById("f3"); 2320 | form3.style.display="none"; 2321 | var form4 = document.getElementById("f4"); 2322 | form4.style.display="none"; 2323 | var form5 = document.getElementById("f5"); 2324 | form5.style.display="none"; 2325 | var form6 = document.getElementById("f6"); 2326 | form6.style.display="none"; 2327 | var form7 = document.getElementById("f7"); 2328 | form7.style.display="none"; 2329 | var form8 = document.getElementById("f8"); 2330 | form8.style.display="block"; 2331 | var form9 = document.getElementById("f9"); 2332 | form9.style.display="none"; 2333 | //-->how much of the progress bar is green 2334 | var progress = document.getElementById("p8"); 2335 | progress.classList.add("active"); 2336 | var progress = document.getElementById("p9"); 2337 | progress.classList.remove("active"); 2338 | //-->how many institutes already present 2339 | var hidden = document.getElementById("hidden_accomplishments"); 2340 | var no = parseInt(hidden.innerText); 2341 | //-->remove most current subtitle 2342 | var subtititle = document.getElementById("sub"+accomplishments_info_list_name[no-1][0]); 2343 | subtititle.remove(); 2344 | //-->remove most current labels and textfields 2345 | for(var i=0; i<2; i++){ 2346 | //-->remove text fields 2347 | var text = document.getElementsByName(accomplishments_info_list_name[no-1][i]); 2348 | text[0].remove(); 2349 | //-->remove labels 2350 | var label = document.getElementById(accomplishments_info_list_name[no-1][i]); 2351 | label.remove(); 2352 | } 2353 | //-->update projects_info_list_name 2354 | for(var i=1; i>=0; i--){ 2355 | accomplishments_info_list_name[no-1].splice(i,1); 2356 | } 2357 | accomplishments_info_list_name.splice((no-1),1); 2358 | hidden.innerText=(no-1); 2359 | 2360 | } 2361 | //-->Function to go from form8 -> form9 2362 | function clickform9(){ 2363 | 2364 | 2365 | //-->which forms have to be visible 2366 | var form1 = document.getElementById("f1"); 2367 | form1.style.display="none"; 2368 | var form2 = document.getElementById("f2"); 2369 | form2.style.display="none"; 2370 | var form3 = document.getElementById("f3"); 2371 | form3.style.display="none"; 2372 | var form4 = document.getElementById("f4"); 2373 | form4.style.display="none"; 2374 | var form5 = document.getElementById("f5"); 2375 | form5.style.display="none"; 2376 | var form6 = document.getElementById("f6"); 2377 | form6.style.display="none"; 2378 | var form7 = document.getElementById("f7"); 2379 | form7.style.display="none"; 2380 | var form8 = document.getElementById("f8"); 2381 | form8.style.display="none"; 2382 | var form9 = document.getElementById("f9"); 2383 | form9.style.display="block"; 2384 | //-->how much of the progress bar is green 2385 | var progress = document.getElementById("p9"); 2386 | progress.classList.add("active"); 2387 | if(list_made[8]==false){ 2388 | var lennotzero=true; 2389 | //-->declare list to be used in this form 2390 | var hobbies_info_list=[]; 2391 | //-->fill the list from main string 2392 | for (var i in json_string){ 2393 | if(i=="hobbies_info_list"){ 2394 | if(json_string[i].length>0){ 2395 | for(var j=0; jadd new list to the certifications_info_list 2397 | hobbies_info_list[j] = json_string[i][j]; 2398 | } 2399 | } 2400 | else{ 2401 | lennotzero = false; 2402 | } 2403 | } 2404 | 2405 | } 2406 | if(lennotzero){ 2407 | //console.log(skills_info_list); 2408 | //-->declare list holding names of of the elements 2409 | var count=1; 2410 | //-->dynamically change each name depeneding on list index 2411 | for(var i in hobbies_info_list){ 2412 | hobbies_info_list_name[i] = hb_str1+count; 2413 | count+=1; 2414 | } 2415 | //console.log(skills_info_list_name); 2416 | //-->creating elements 2417 | for(var i in hobbies_info_list){ 2418 | var form9 = document.getElementById("f99"); 2419 | //-->create div in which both div of label and input will be present 2420 | var div = document.createElement("div"); 2421 | div.className="flex-container"; 2422 | form9.appendChild(div); 2423 | //-->create div of label 2424 | var labeldiv = document.createElement("div"); 2425 | labeldiv.className="labeldiv"; 2426 | labeldiv.id=hobbies_info_list_name[i]; 2427 | div.appendChild(labeldiv); 2428 | //-->create label 2429 | var label = document.createElement("label"); 2430 | var j=parseInt(i)+1; 2431 | label.innerText="Hobby "+(j)+":"; 2432 | labeldiv.appendChild(label); 2433 | //-->create input 2434 | var input = document.createElement("input"); 2435 | input.type="text"; 2436 | input.value=hobbies_info_list[i]; 2437 | //-->put value from list into input element 2438 | input.name=hobbies_info_list_name[i]; 2439 | div.appendChild(input); 2440 | } 2441 | } 2442 | //-->update hidden value 2443 | var no = hobbies_info_list.length; 2444 | var hidden = document.getElementById("hidden_hobbies"); 2445 | hidden.innerText=(no); 2446 | var form9 = document.getElementById("f99"); 2447 | //-->create div in which remove button will be present 2448 | var div = document.createElement("div"); 2449 | div.className="flex-container"; 2450 | form9.appendChild(div); 2451 | //-->create remove button 2452 | var remove_button = document.createElement("input"); 2453 | remove_button.type="button"; 2454 | remove_button.name="remove_hobby"; 2455 | remove_button.className="remove"; 2456 | remove_button.onclick=removehobby; 2457 | remove_button.value="Remove"; 2458 | remove_button.id="hb_remove"; 2459 | div.appendChild(remove_button); 2460 | //-->create add button 2461 | var add_button = document.createElement("input"); 2462 | add_button.type="button"; 2463 | add_button.name="add_hobby"; 2464 | add_button.className="add"; 2465 | add_button.onclick=addhobby; 2466 | add_button.value="Add"; 2467 | add_button.id="hb_add"; 2468 | div.appendChild(add_button); 2469 | //-->create div in which both previous and next button will be present 2470 | var div = document.createElement("div"); 2471 | div.className="flex-container"; 2472 | form9.appendChild(div); 2473 | //-->create previous button 2474 | var previous_button = document.createElement("input"); 2475 | previous_button.type="button"; 2476 | previous_button.name="previous"; 2477 | previous_button.className="previous action-button"; 2478 | previous_button.onclick=clickform8; 2479 | previous_button.value="Previous"; 2480 | previous_button.id="hb_previous"; 2481 | div.appendChild(previous_button); 2482 | //-->create next button 2483 | var submit_button = document.createElement("input"); 2484 | submit_button.type="submit"; 2485 | submit_button.name="submit"; 2486 | submit_button.className="submit action-button"; 2487 | //next_button.onclick=clickform7; 2488 | submit_button.value="Submit"; 2489 | submit_button.id="hb_submit"; 2490 | div.appendChild(submit_button); 2491 | list_made[8]=true; 2492 | } 2493 | var d1 = document.getElementById("hidden_basic"); 2494 | //console.log(d1.innerText); 2495 | var i1 = document.getElementById("hidden_basic1"); 2496 | i1.value=d1.innerText; 2497 | var d2 = document.getElementById("hidden_education"); 2498 | //console.log(d2.innerText); 2499 | var i2 = document.getElementById("hidden_education1"); 2500 | i2.value=d2.innerText; 2501 | var d3 = document.getElementById("hidden_projects"); 2502 | //console.log(d3.innerText); 2503 | var i3 = document.getElementById("hidden_projects1"); 2504 | i3.value=d3.innerText; 2505 | var d4 = document.getElementById("hidden_certifications"); 2506 | //console.log(d4.innerText); 2507 | var i4 = document.getElementById("hidden_certifications1"); 2508 | i4.value=d4.innerText; 2509 | var d5 = document.getElementById("hidden_experience"); 2510 | //console.log(d5.innerText); 2511 | var i5 = document.getElementById("hidden_experience1"); 2512 | i5.value=d5.innerText; 2513 | var d6 = document.getElementById("hidden_skils"); 2514 | //console.log(d6.innerText); 2515 | var i6 = document.getElementById("hidden_skils1"); 2516 | i6.value=d6.innerText; 2517 | var d7 = document.getElementById("hidden_volunteer"); 2518 | //console.log(d7.innerText); 2519 | var i7 = document.getElementById("hidden_volunteer1"); 2520 | i7.value=d7.innerText; 2521 | var d8 = document.getElementById("hidden_accomplishments"); 2522 | //console.log(d8.innerText); 2523 | var i8 = document.getElementById("hidden_accomplishments1"); 2524 | i8.value=d8.innerText; 2525 | var d9 = document.getElementById("hidden_hobbies"); 2526 | //console.log(d9.innerText); 2527 | var i9 = document.getElementById("hidden_hobbies1"); 2528 | i9.value=d9.innerText; 2529 | } 2530 | function addhobby(){ 2531 | 2532 | //-->which forms have to be visible 2533 | var form1 = document.getElementById("f1"); 2534 | form1.style.display="none"; 2535 | var form2 = document.getElementById("f2"); 2536 | form2.style.display="none"; 2537 | var form3 = document.getElementById("f3"); 2538 | form3.style.display="none"; 2539 | var form4 = document.getElementById("f4"); 2540 | form4.style.display="none"; 2541 | var form5 = document.getElementById("f5"); 2542 | form5.style.display="none"; 2543 | var form6 = document.getElementById("f6"); 2544 | form6.style.display="none"; 2545 | var form7 = document.getElementById("f7"); 2546 | form7.style.display="none"; 2547 | var form8 = document.getElementById("f8"); 2548 | form8.style.display="none"; 2549 | var form9 = document.getElementById("f9"); 2550 | form9.style.display="block"; 2551 | //-->how much of the progress bar is green 2552 | var progress = document.getElementById("p9"); 2553 | progress.classList.add("active"); 2554 | //-->how many institutes already present 2555 | var hidden = document.getElementById("hidden_hobbies"); 2556 | var no = parseInt(hidden.innerText); 2557 | //-->remove buttons 2558 | var add_button = document.getElementById("hb_add"); 2559 | add_button.remove(); 2560 | var remove_button = document.getElementById("hb_remove"); 2561 | remove_button.remove(); 2562 | var previous_button = document.getElementById("hb_previous"); 2563 | previous_button.remove(); 2564 | var submit_button = document.getElementById("hb_submit"); 2565 | submit_button.remove(); 2566 | //-->add elements 2567 | var form9 = document.getElementById("f99"); 2568 | var no = no+1; 2569 | hidden.innerText=(no); 2570 | //-->add elements in education_info_list_name 2571 | hobbies_info_list_name[no-1] = hb_str1+no; 2572 | var form9 = document.getElementById("f99"); 2573 | //-->create div in which both div of label and input will be present 2574 | var div = document.createElement("div"); 2575 | div.className="flex-container"; 2576 | form9.appendChild(div); 2577 | //-->create div of label 2578 | var labeldiv = document.createElement("div"); 2579 | labeldiv.className="labeldiv"; 2580 | labeldiv.id=hobbies_info_list_name[no-1]; 2581 | div.appendChild(labeldiv); 2582 | //-->create label 2583 | var label = document.createElement("label"); 2584 | label.innerText="Hobby "+(no)+":"; 2585 | labeldiv.appendChild(label); 2586 | //-->create input 2587 | var input = document.createElement("input"); 2588 | input.type="text"; 2589 | //-->put value from list into input element 2590 | input.name=hobbies_info_list_name[no-1]; 2591 | div.appendChild(input); 2592 | var form9 = document.getElementById("f99"); 2593 | //-->create div in which remove button will be present 2594 | var div = document.createElement("div"); 2595 | div.className="flex-container"; 2596 | form9.appendChild(div); 2597 | //-->create remove button 2598 | var remove_button = document.createElement("input"); 2599 | remove_button.type="button"; 2600 | remove_button.name="remove_hobby"; 2601 | remove_button.className="remove"; 2602 | remove_button.onclick=removehobby; 2603 | remove_button.value="Remove"; 2604 | remove_button.id="hb_remove"; 2605 | div.appendChild(remove_button); 2606 | //-->create add button 2607 | var add_button = document.createElement("input"); 2608 | add_button.type="button"; 2609 | add_button.name="add_hobby"; 2610 | add_button.className="add"; 2611 | add_button.onclick=addhobby; 2612 | add_button.value="Add"; 2613 | add_button.id="hb_add"; 2614 | div.appendChild(add_button); 2615 | //-->create div in which both previous and next button will be present 2616 | var div = document.createElement("div"); 2617 | div.className="flex-container"; 2618 | form9.appendChild(div); 2619 | //-->create previous button 2620 | var previous_button = document.createElement("input"); 2621 | previous_button.type="button"; 2622 | previous_button.name="previous"; 2623 | previous_button.className="previous action-button"; 2624 | previous_button.onclick=clickform8; 2625 | previous_button.value="Previous"; 2626 | previous_button.id="hb_previous"; 2627 | div.appendChild(previous_button); 2628 | //-->create next button 2629 | var submit_button = document.createElement("input"); 2630 | submit_button.type="submit"; 2631 | submit_button.name="submit"; 2632 | submit_button.className="submit action-button"; 2633 | //next_button.onclick=clickform7; 2634 | submit_button.value="Submit"; 2635 | submit_button.id="hb_submit"; 2636 | div.appendChild(submit_button); 2637 | var d9 = document.getElementById("hidden_hobbies"); 2638 | //console.log(d9.innerText); 2639 | var i9 = document.getElementById("hidden_hobbies1"); 2640 | i9.value=d9.innerText; 2641 | } 2642 | function removehobby(){ 2643 | //-->which forms have to be visible 2644 | var form1 = document.getElementById("f1"); 2645 | form1.style.display="none"; 2646 | var form2 = document.getElementById("f2"); 2647 | form2.style.display="none"; 2648 | var form3 = document.getElementById("f3"); 2649 | form3.style.display="none"; 2650 | var form4 = document.getElementById("f4"); 2651 | form4.style.display="none"; 2652 | var form5 = document.getElementById("f5"); 2653 | form5.style.display="none"; 2654 | var form6 = document.getElementById("f6"); 2655 | form6.style.display="none"; 2656 | var form7 = document.getElementById("f7"); 2657 | form7.style.display="none"; 2658 | var form8 = document.getElementById("f8"); 2659 | form8.style.display="none"; 2660 | var form9 = document.getElementById("f9"); 2661 | form9.style.display="block"; 2662 | //-->how much of the progress bar is green 2663 | var progress = document.getElementById("p9"); 2664 | progress.classList.add("active"); 2665 | //-->how many institutes already present 2666 | var hidden = document.getElementById("hidden_hobbies"); 2667 | var no = parseInt(hidden.innerText); 2668 | //-->remove text fields 2669 | var text = document.getElementsByName(hobbies_info_list_name[no-1]); 2670 | text[0].remove(); 2671 | //-->remove labels 2672 | var label = document.getElementById(hobbies_info_list_name[no-1]); 2673 | label.remove(); 2674 | hobbies_info_list_name.splice((no-1),1); 2675 | hidden.innerText=(no-1); 2676 | var d9 = document.getElementById("hidden_hobbies"); 2677 | //console.log(d9.innerText); 2678 | var i9 = document.getElementById("hidden_hobbies1"); 2679 | i9.value=d9.innerText; 2680 | } 2681 | function readTextFile(file, callback) { 2682 | var rawFile = new XMLHttpRequest(); 2683 | rawFile.overrideMimeType("application/json"); 2684 | rawFile.open("GET", file, true); 2685 | rawFile.onreadystatechange = function() { 2686 | if (rawFile.readyState === 4 && rawFile.status == "200") { 2687 | callback(rawFile.responseText); 2688 | } 2689 | } 2690 | rawFile.send(null); 2691 | //to call function 2692 | //readTextFile("../scraped_data.json", function(text){ 2693 | //var data = JSON.parse(text); 2694 | } 2695 | 2696 | function writeTextFile(file, callback) { 2697 | var rawFile = new XMLHttpRequest(); 2698 | rawFile.overrideMimeType("application/json"); 2699 | rawFile.open("PUT", file, true); 2700 | rawFile.onreadystatechange = function() { 2701 | if (rawFile.readyState === 4 && rawFile.status == "200") { 2702 | callback(rawFile.responseText); 2703 | } 2704 | } 2705 | rawFile.send(null); 2706 | } 2707 | function saveFile(text, name, type) { 2708 | var a = document.createElement("a"); 2709 | var file = new Blob([text], {type: type}); 2710 | a.href = URL.createObjectURL(file); 2711 | a.download = name; 2712 | a.click(); 2713 | } 2714 | //saveFile(JSON.stringify(basic_info_list), 'config.json', 'text/plain'); 2715 | --------------------------------------------------------------------------------