Improve devloop
This commit is contained in:
parent
31f2636dd8
commit
a8b321a47d
|
@ -1,12 +1,10 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
import os
|
||||
|
||||
from latecomers.parse import find_table, get_details
|
||||
|
||||
with open("./devloop/sample.html") as f:
|
||||
with open("./devloop/sample3.html") as f:
|
||||
content = f.read()
|
||||
|
||||
flights = find_table(content)
|
||||
|
||||
for f in flights:
|
||||
print(get_details(f, os.environ.get("DEBUG") is not None))
|
||||
print(get_details(f))
|
||||
|
|
19795
devloop/sample3.html
Normal file
19795
devloop/sample3.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,22 +1,25 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
import os
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from latecomers.parse import find_table, get_details
|
||||
from latecomers.serializer import to_excel
|
||||
|
||||
with open("./devloop/sample.html") as f:
|
||||
with open("./devloop/sample3.html") as f:
|
||||
content = f.read()
|
||||
|
||||
flights = find_table(content)
|
||||
data = []
|
||||
|
||||
for f in flights:
|
||||
data.append(get_details(f, os.environ.get("DEBUG") is not None))
|
||||
data.append(get_details(f))
|
||||
|
||||
print(to_excel(data))
|
||||
|
||||
colonne = {"th_arrival": "Arrivo teorico", "real_arrival": "Arrivo reale",
|
||||
"code": "Codice volo", "origin": "Aeroporto di partenza", "status": "Stato"}
|
||||
colonne = {
|
||||
"th_arrival": "Arrivo teorico",
|
||||
"real_arrival": "Arrivo reale",
|
||||
"code": "Codice volo",
|
||||
"origin": "Aeroporto di partenza",
|
||||
"status": "Stato",
|
||||
}
|
||||
df = pd.DataFrame(data, columns=colonne)
|
||||
|
|
Loading…
Reference in New Issue
Block a user