mirari commited on
Commit
5ec3b38
·
verified ·
1 Parent(s): 22a077d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -3
README.md CHANGED
@@ -96,10 +96,32 @@ for en in enlaces:
96
  if str(mydivs)!='[]':
97
  nombre = en.split('/')[-2]
98
  lf = soup.find_all("section", {"itemprop":"articleBody"})
99
- lf = str(lf).split("<figure")[0]
 
 
 
 
 
 
 
 
100
  lc = soup.find_all("section", {"class":"post-lectura-dificil"})
101
  with open('./plenaInclusionEspaña/lecturaFacil/lf-'+nombre+'.txt', 'w') as f:
102
- f.write(lf)
103
  with open('./plenaInclusionEspaña/lecturaCompleja/lc-'+nombre+'.txt', 'w') as f:
104
- f.write(str(lc))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  ```
 
96
  if str(mydivs)!='[]':
97
  nombre = en.split('/')[-2]
98
  lf = soup.find_all("section", {"itemprop":"articleBody"})
99
+ lf = str(lf).split("<figure")
100
+ texto = lf[0]
101
+ for i in range(len(lf)-1):
102
+ if "</figure>" in lf[i+1]:
103
+ if(len(lf[i+1].split("</figure>"))>2):
104
+ sinIm = lf[i+1].split("</figure>")[2]
105
+ else:
106
+ sinIm = lf[i+1].split("</figure>")[1]
107
+ texto = texto + sinIm
108
  lc = soup.find_all("section", {"class":"post-lectura-dificil"})
109
  with open('./plenaInclusionEspaña/lecturaFacil/lf-'+nombre+'.txt', 'w') as f:
110
+ f.write(str(lf[0]))
111
  with open('./plenaInclusionEspaña/lecturaCompleja/lc-'+nombre+'.txt', 'w') as f:
112
+ f.write(str(lc[0]))
113
+ else:
114
+ nombre = en.split('/')[-2]
115
+ lf = soup.find_all("section", {"itemprop":"articleBody"})
116
+ lf = str(lf).split("<figure")
117
+ texto = lf[0]
118
+ for i in range(len(lf)-1):
119
+ if "</figure>" in lf[i+1]:
120
+ if(len(lf[i+1].split("</figure>"))>2):
121
+ sinIm = lf[i+1].split("</figure>")[2]
122
+ else:
123
+ sinIm = lf[i+1].split("</figure>")[1]
124
+ texto = texto + sinIm
125
+ with open('./plenaInclusionEspaña/soloFacil/' + nombre + '.txt', 'w') as f:
126
+ f.write(texto)
127
  ```