Browse Source

Miupi Parsing added

Daniel Suazo 4 years ago
parent
commit
5fcb8be3a3

+ 1
- 0
Miupi Parser/Admi.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Admi_Grad.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Arqui.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Arqui_Grad.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Asuntos_Aca.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Ciencia_Tech_Info_Grad.json View File

@@ -0,0 +1 @@
1
+[{"Curso": "CINF6017", "Seccion": "LU1", "Profesor": "CENTENO CASILLA", "Nombre": "PROG BIB ESC INT CURRICU", "Dias": ["M"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6019", "Seccion": "HU1", "Profesor": "PAGAN SANTANA L", "Nombre": "FUNCION BIBLIOT EDUC SUP", "Dias": ["M"], "Horario": ["05:00PM-07:50PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6209", "Seccion": "HU1", "Profesor": "VELEZ NATAL, B ", "Nombre": "ORG MANEJO DOCS ACCES IN", "Dias": ["W"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6415", "Seccion": "HU1", "Profesor": "SANCHEZ LUGO, J", "Nombre": "PLANIFICACION ESTRATEGIC", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6417", "Seccion": "HU1", "Profesor": "VELEZ NATAL, BE", "Nombre": "ADMINISTRADOR DE DOCUMEN", "Dias": ["L"], "Horario": ["09:00AM-11:50AM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6705", "Seccion": "L02", "Profesor": "SUAREZ BALSEIRO", "Nombre": "INFO CONOC Y SOCIEDAD", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6706", "Seccion": "H01", "Profesor": "VIGO CPEDA,L ", "Nombre": "METOD INV EN CINF", "Dias": ["M"], "Horario": ["05:00PM-07:50PM"], "Info_Extra": ""}, {"Curso": "CINF6706", "Seccion": "L02", "Profesor": "SANCHEZ LUGO, J", "Nombre": "METOD INV EN CINF", "Dias": ["M"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6707", "Seccion": "L02", "Profesor": "FLORES CARABALL", "Nombre": "TECNOL INFO CONOCIMIENTO", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6708", "Seccion": "H01", "Profesor": "SANCHEZ LUGO, J", "Nombre": "FUND ORGANIZ INFORMA CONO", "Dias": ["J"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6708", "Seccion": "L02", "Profesor": "SUAREZ BALSEIRO", "Nombre": "FUND ORGANIZ INFORMA CONO", "Dias": ["J"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6800", "Seccion": "HU1", "Profesor": "VELEZ NATAL, B ", "Nombre": "EXP CLINICAS SERV INFO", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "CINF6805", "Seccion": "LU1", "Profesor": "SANCHEZ LUGO,J ", "Nombre": "EXP CLINICAS BIB ESCOLAR", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "CINF6806", "Seccion": "H01", "Profesor": "VIGO CEPEDA,L ", "Nombre": "ORG Y RECUP INFO Y CONOCI", "Dias": ["J"], "Horario": ["05:00PM-07:50PM"], "Info_Extra": ""}, {"Curso": "CINF6806", "Seccion": "L02", "Profesor": "ROBLEDO GONZALE", "Nombre": "ORG Y RECUP INFO Y CONOCI", "Dias": ["M"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6807", "Seccion": "L01", "Profesor": "SUAREZ BALSEIRO", "Nombre": "PRODUCTS Y SERVICI DE REF", "Dias": ["W"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "CINF6809", "Seccion": "LU1", "Profesor": "ORTIZ MALAVE, J", "Nombre": "SELECC ADQUI REC INFO CON", "Dias": ["W"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6815", "Seccion": "LU1", "Profesor": "DOMINGUEZ FLORE", "Nombre": "COMP INFORMAC Y TECNOLOGI", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6816", "Seccion": "H01", "Profesor": "VIGO CEPEDA, L ", "Nombre": "ADM SERV DE INFORMACION", "Dias": ["W"], "Horario": ["05:00PM-07:50PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6905", "Seccion": "HU1", "Profesor": "FLORES CARABALL", "Nombre": "FUNDAM GEREN CONOCIMIENTO", "Dias": ["J"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "CINF6998", "Seccion": "A01", "Profesor": "VIGO CEPEDA, L ", "Nombre": "SEM APL CONC (CAPSTONE)", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "CINF6998", "Seccion": "A02", "Profesor": "VELEZ NATAL,B ", "Nombre": "SEM APL CONC (CAPSTONE)", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "CINF6998", "Seccion": "A03", "Profesor": "SANCHEZ LUGO,J ", "Nombre": "SEM APL CONC (CAPSTONE)", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "CINF6998", "Seccion": "A04", "Profesor": "FLORES CARBALLO", "Nombre": "SEM APL CONC (CAPSTONE)", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "CINF6998", "Seccion": "A05", "Profesor": "SUAREZ BALSEIRO", "Nombre": "SEM APL CONC (CAPSTONE)", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}]

+ 1
- 0
Miupi Parser/Ciencias_Militares.json View File

@@ -0,0 +1 @@
1
+[{"Curso": "CIMI3011", "Seccion": "001", "Profesor": "MCGEE, SHANNON ", "Nombre": "CURSO BASIC C. MILIT I", "Dias": ["LW"], "Horario": ["01:00PM-01:50PM"], "Info_Extra": ""}, {"Curso": "CIMI3021", "Seccion": "001", "Profesor": "MEYERS, JOSHUA ", "Nombre": "CURS BASIC C.MILIT III", "Dias": ["LW"], "Horario": ["10:30AM-11:20AM"], "Info_Extra": ""}, {"Curso": "CIMI4011", "Seccion": "001", "Profesor": "MEYERS, JOSHUA ", "Nombre": "COM Y PSIC EN LID MILITAR", "Dias": ["LW"], "Horario": ["08:00PM-09:50PM"], "Info_Extra": ""}, {"Curso": "CIMI4021", "Seccion": "001", "Profesor": "ROJAS, ORLANDO ", "Nombre": "LID Y ADM OPERACIONES MIL", "Dias": ["MJ"], "Horario": ["06:30AM-08:50AM"], "Info_Extra": ""}, {"Curso": "ESAE3001", "Seccion": "001", "Profesor": "TORRES, C. ", "Nombre": "LA FUERZA AEREA DE HOY", "Dias": ["L", "V"], "Horario": ["09:00AM-09:50AM", "09:00AM-10:50AM"], "Info_Extra": ""}, {"Curso": "ESAE3001", "Seccion": "002", "Profesor": "TORRES, C. ", "Nombre": "LA FUERZA AEREA DE HOY", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "ESAE3011", "Seccion": "002", "Profesor": "NIEVES,RICARDO ", "Nombre": "DESARR DEL PODERIO AEREO", "Dias": ["W", "V"], "Horario": ["09:00AM-09:50AM", "09:00AM-10:50AM"], "Info_Extra": ""}, {"Curso": "ESAE4001", "Seccion": "001", "Profesor": "MENDOZA, JOEL ", "Nombre": "GER,LID EN LA FUERZA AERE", "Dias": ["LW", "V"], "Horario": ["10:00AM-11:20AM", "09:00AM-10:50AM"], "Info_Extra": ""}, {"Curso": "ESAE4011", "Seccion": "001", "Profesor": "NIEVES, RICARDO", "Nombre": "SEG NAC SOC AMER CONTEMP", "Dias": ["LW", "V"], "Horario": ["10:00AM-11:20AM", "09:00AM-10:50AM"], "Info_Extra": ""}]

+ 1
- 0
Miupi Parser/Comunicaciones.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Comunicaciones_Grad.json View File

@@ -0,0 +1 @@
1
+[{"Curso": "COPU6500", "Seccion": "2U1", "Profesor": "ROCHE,MARIO ", "Nombre": "TEORIAS DE LA COMUNICACIO", "Dias": ["M"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "COPU6517", "Seccion": "2U1", "Profesor": "RAMIREZ,RUBEN ", "Nombre": "CULT Y ESTRUC MEDIATICAS", "Dias": ["W"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "COPU6667", "Seccion": "2U1", "Profesor": "COLON,ELISEO ", "Nombre": "PERSP Y METOD INV EN COM", "Dias": ["L"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}, {"Curso": "COPU6698", "Seccion": "0U1", "Profesor": "COLON,ELISEO ", "Nombre": "CONT EXP INVEST DIV MODS", "Dias": ["J"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": ""}, {"Curso": "COPU6707", "Seccion": "001", "Profesor": "COLON,ELISEO ", "Nombre": "SEMINAR COMUNICACION III", "Dias": ["M"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": ""}, {"Curso": "COPU6707", "Seccion": "002", "Profesor": "ALVARADO, G. ", "Nombre": "SEMINAR COMUNICACION III", "Dias": ["L"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": ""}, {"Curso": "COPU6726", "Seccion": "2U1", "Profesor": "ROCHE,MARIO ", "Nombre": "SEMINARION EN PERIOD II", "Dias": ["J"], "Horario": ["06:00PM-08:50PM"], "Info_Extra": "* Curso no se ofrecer\u00e1 en el 2DO SEM *"}]

+ 1
- 0
Miupi Parser/Derecho.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Educacion.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Educacion_Continua.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Educacion_Grad.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Generales.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Humanidades.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Humanidades_Grad.json
File diff suppressed because it is too large
View File


+ 5715
- 0
Miupi Parser/Naturales.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Naturales_Grad.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Planificacion.json View File

@@ -0,0 +1 @@
1
+[{"Curso": "PLAN5005", "Seccion": "3U1", "Profesor": "YOEL VELAZQUEZ ", "Nombre": "ECON ESTA Y MATE PLANIF", "Dias": ["S"], "Horario": ["09:00AM-01:00PM"], "Info_Extra": ""}, {"Curso": "PLAN6006", "Seccion": "0U1", "Profesor": "IRIZARRY, R. ", "Nombre": "INTERNADO DE PLANIFICACIO", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6068", "Seccion": "013", "Profesor": "LUGO, J. ", "Nombre": "PRESERV PATRIMON Y PLANIF", "Dias": ["J"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6075", "Seccion": "2U1", "Profesor": "IRIZARRY, R. ", "Nombre": "PROYECTO DE INVESTIG II", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6076", "Seccion": "2U1", "Profesor": "LAMBA DEEPAK ", "Nombre": "HIST & TEORIA PLAN", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6089", "Seccion": "2U1", "Profesor": "ENCARNACION, A.", "Nombre": "PLANIF URB Y TERRITORIAL", "Dias": ["W"], "Horario": ["07:00PM-09:50PM"], "Info_Extra": ""}, {"Curso": "PLAN6116", "Seccion": "2U1", "Profesor": "GONZALEZ VERON ", "Nombre": "ORDEN JURIDICO PLAN", "Dias": ["J"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6117", "Seccion": "2U1", "Profesor": "CASTRO, A . ", "Nombre": "APLIC COMPUTADOR EN PLAN", "Dias": ["W"], "Horario": ["05:30PM-09:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6135", "Seccion": "2U1", "Profesor": "ENCARNACION, A,", "Nombre": "SOCIEDAD AMBIENTE Y PLAN", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6513", "Seccion": "2U1", "Profesor": "IRIZARRY, R. ", "Nombre": "SEM PROP PROYECTO PLANIFI", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6602", "Seccion": "2U1", "Profesor": "CASTRO, A. ", "Nombre": "SIG PARA PLANIFICACION", "Dias": ["MJ"], "Horario": ["05:30PM-07:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6603", "Seccion": "2U1", "Profesor": "NAVARRO, C. ", "Nombre": "ELABORACION DE PLANES", "Dias": ["L"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6604", "Seccion": "2U1", "Profesor": "SANTIAGO, R. ", "Nombre": "TEOR COMUNIDAD Y DES ECON", "Dias": ["J"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6614", "Seccion": "201", "Profesor": "BARRETO, M. ", "Nombre": "PROYECTO DE PLANIFICACION", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6614", "Seccion": "202", "Profesor": "NAVARRO, C. ", "Nombre": "PROYECTO DE PLANIFICACION", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6896", "Seccion": "201", "Profesor": "BARRETO, M. ", "Nombre": "CONTINUACION PROY PLAN", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6896", "Seccion": "202", "Profesor": "PENA, P. ", "Nombre": "CONTINUACION PROY PLAN", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6896", "Seccion": "203", "Profesor": "NAVARRO, C. ", "Nombre": "CONTINUACION PROY PLAN", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}, {"Curso": "PLAN6995", "Seccion": "011", "Profesor": "MIRANDA, C. ", "Nombre": "SEM: DESARROLLO PROPUESTA", "Dias": ["LMW", "S"], "Horario": ["05:30PM-08:20PM", "09:00AM-11:00AM"], "Info_Extra": ""}, {"Curso": "PLAN6995", "Seccion": "013", "Profesor": "BARRETO MARITZA", "Nombre": "RIESGOS Y PLANIFICACIONN", "Dias": ["W"], "Horario": ["05:30PM-08:20PM"], "Info_Extra": ""}, {"Curso": "PLAN6996", "Seccion": "2U1", "Profesor": "NAVARRO, C. ", "Nombre": "PRACTICA DE PLANIFICACION", "Dias": ["D"], "Horario": ["TBA"], "Info_Extra": ""}]

+ 1
- 0
Miupi Parser/Sociales.json
File diff suppressed because it is too large
View File


+ 1
- 0
Miupi Parser/Sociales_Grad.json
File diff suppressed because it is too large
View File


+ 82
- 0
Miupi Parser/parse.py View File

@@ -0,0 +1,82 @@
1
+import pandas as pd
2
+import json
3
+from os import remove
4
+
5
+
6
+def initial_parse(name, url):
7
+
8
+    table_MN = pd.read_html(url)
9
+    df = table_MN[0]
10
+    df.columns = ['Curso', 'Nombre', 'c', 'Dias', 'Hora', 'f']
11
+
12
+    upi = df[['Curso', 'Nombre', 'Dias', 'Hora']]
13
+    # print(upi.head())
14
+    # print(upi.to_json(orient='records'))
15
+
16
+    # puedes usar esta alternativa o la de la linea 17
17
+    # upi.to_json(r'C:\Users\diego\Documents\miupi_parse\soup\file.json')
18
+    upi.to_json(f'{name}_temp.json', orient='records')
19
+
20
+
21
+def final_parse(name):
22
+
23
+    with open(f"{name}_temp.json") as f_in:
24
+        data = json.load(f_in)
25
+
26
+    newdata = []
27
+
28
+    for item in data:
29
+        if(item["Curso"] == None):
30
+            pass
31
+        else:
32
+            course = {}
33
+            course["Curso"] = item["Curso"][0:8]
34
+            course["Seccion"] = item["Curso"][9:12]
35
+            info = item["Nombre"].split("Profesor: ")
36
+            if((profesor := info[1][0:-11]) != ""):
37
+                course["Profesor"] = profesor
38
+            else:
39
+                course["Profesor"] = "TBA"
40
+            course["Nombre"] = info[0][0:-1]
41
+            course["Dias"] = item["Dias"].split(" ")
42
+            horario = []
43
+            if(item["Hora"] != None):
44
+                for i in range(len(course["Dias"])):
45
+                    horario.append(item["Hora"][15*i:15*(i+1)])
46
+            else:
47
+                horario.append("TBA")
48
+            course["Horario"] = horario
49
+            course["Info_Extra"] = item["Curso"][13:-1]
50
+            newdata.append(course)
51
+
52
+    with open(f'{name}.json', 'w') as f_out:
53
+        json.dump(newdata, f_out)
54
+
55
+
56
+if __name__ == "__main__":
57
+    faculty_urls = {"Asuntos_Aca": "https://miupi.uprrp.edu/horarios/RBA120_AA.HTML",
58
+                    "Admi": "https://miupi.uprrp.edu/horarios/RBA120_AE.HTML",
59
+                    "Admi_Grad": "https://miupi.uprrp.edu/horarios/RBA120_AE2.HTML",
60
+                    "Arqui": "https://miupi.uprrp.edu/horarios/RBA120_AQ.HTML",
61
+                    "Arqui_Grad": "https://miupi.uprrp.edu/horarios/RBA120_AQ2.HTML",
62
+                    "Ciencia_Tech_Info_Grad": "https://miupi.uprrp.edu/horarios/RBA120_CB.HTML",
63
+                    "Ciencias_Militares": "https://miupi.uprrp.edu/horarios/RBA120_CM.HTML",
64
+                    "Naturales": "https://miupi.uprrp.edu/horarios/RBA120_CN.HTML",
65
+                    "Naturales_Grad": "https://miupi.uprrp.edu/horarios/RBA120_CN2.HTML",
66
+                    "Comunicaciones": "https://miupi.uprrp.edu/horarios/RBA120_CP.HTML",
67
+                    "Comunicaciones_Grad": "https://miupi.uprrp.edu/horarios/RBA120_CP2.HTML",
68
+                    "Sociales": "https://miupi.uprrp.edu/horarios/RBA120_CS.HTML",
69
+                    "Sociales_Grad": "https://miupi.uprrp.edu/horarios/RBA120_CS2.HTML	",
70
+                    "Derecho": "https://miupi.uprrp.edu/horarios/RBA120_DE.HTML",
71
+                    "Educacion_Continua": "https://miupi.uprrp.edu/horarios/RBA120_EC.HTML",
72
+                    "Educacion": "https://miupi.uprrp.edu/horarios/RBA120_ED.HTML",
73
+                    "Educacion_Grad": "https://miupi.uprrp.edu/horarios/RBA120_ED2.HTML",
74
+                    "Generales": "https://miupi.uprrp.edu/horarios/RBA120_EG.HTML",
75
+                    "Humanidades": "https://miupi.uprrp.edu/horarios/RBA120_HU.HTML",
76
+                    "Humanidades_Grad": "https://miupi.uprrp.edu/horarios/RBA120_HU2.HTML",
77
+                    "Planificacion": "https://miupi.uprrp.edu/horarios/RBA120_PL.HTML"}
78
+    #initial_parse("Naturales", faculty_urls["Naturales"])
79
+    for key in faculty_urls:
80
+        initial_parse(key, faculty_urls[key])
81
+        final_parse(key)
82
+        remove(f"{key}_temp.json")

+ 4
- 0
Miupi Parser/test.py View File

@@ -0,0 +1,4 @@
1
+string = "help"
2
+what = [string[2:]]
3
+print(string)
4
+print(what)

+ 24760
- 0
natu.html
File diff suppressed because it is too large
View File


+ 11
- 0
test.py View File

@@ -0,0 +1,11 @@
1
+import requests
2
+from bs4 import BeautifulSoup
3
+
4
+f = open("natu.html", "a")
5
+natSci = "https://miupi.uprrp.edu/horarios/RBA120_CN.HTML"
6
+page = requests.get(natSci)
7
+
8
+soup = BeautifulSoup(page.content, 'html.parser')
9
+
10
+f.write(soup.prettify())
11
+f.close()