index fix
This commit is contained in:
parent
5c8fadf233
commit
3929dcdebf
1 changed files with 10 additions and 3 deletions
|
@ -10,6 +10,7 @@ import html2text
|
|||
import pdfkit
|
||||
import locale
|
||||
import PyPDF2
|
||||
import html
|
||||
|
||||
locale.setlocale(locale.LC_TIME, 'it_IT.UTF-8')
|
||||
|
||||
|
@ -161,9 +162,15 @@ def main():
|
|||
|
||||
for vgo in all_vgos:
|
||||
vgo_num = html2text.html2text(vgo['content']).split(' ')[0]
|
||||
vgo_name = os.linesep.join([s for s in html2text.html2text(vgo['content']).splitlines() if s]).splitlines()[-1]
|
||||
if len(vgo_name) < 10:
|
||||
vgo_name = [s for s in html2text.html2text(vgo['content']).split("\n\n") if s][-1].replace("\n"," ")
|
||||
# vgo_name = os.linesep.join([s for s in html2text.html2text(vgo['content']).splitlines() if s]).splitlines()[-1]
|
||||
# if len(vgo_name) < 10:
|
||||
# vgo_name = [s for s in html2text.html2text(vgo['content']).split("\n\n") if s][-1].replace("\n"," ")
|
||||
|
||||
vgo_name = vgo['content'].split("<p>")[-1].replace("</p>","")
|
||||
vgo_name = vgo_name.split("<br />")[-1]
|
||||
vgo_name = vgo_name.split("</a>")[-1]
|
||||
vgo_name = html.unescape(vgo_name).strip()
|
||||
|
||||
#print(vgo_num +' - '+ vgo_name)
|
||||
#print(str(vgo['id']) +' '+ vgo['uri'])
|
||||
vgo_dict[vgo_num] = vgo_name
|
||||
|
|
Loading…
Reference in a new issue