Skip to content

Commit d079758

Browse files
committed
[Fix] Update parsing to not remove last row
Fixes #24
1 parent 72beb27 commit d079758

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

main.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ def getLabel(label, label_type="account", input_type='single'):
6363
try:
6464
# Select relevant table from multiple tables in the page, based on current table index
6565
curTable = pd.read_html(driver.page_source)[table_index]
66-
if label_type == "account":
67-
# Remove last item which is just sum
68-
curTable = curTable[:-1]
6966
print(curTable)
7067

7168
# Retrieve all addresses from table
@@ -88,6 +85,7 @@ def getLabel(label, label_type="account", input_type='single'):
8885

8986
# If table is less than 100, then we have reached the end
9087
if (len(curTable.index) == 100):
88+
# TODO: Standardize index incrementation
9189
if label_type == "account":
9290
index += 100
9391
driver.get(baseUrl.format(
@@ -143,10 +141,9 @@ def getLabelOldFormat(label, label_type="account", input_type='single'):
143141
print(e)
144142
print(label, "Skipping label due to error")
145143
return
146-
# Remove last item which is just sum
147-
table_list.append(newTable[:-1])
144+
148145
index += 100
149-
if (len(newTable.index) != 101):
146+
if (len(newTable.index) != 100):
150147
break
151148

152149
df = pd.concat(table_list) # Combine all dataframes

0 commit comments

Comments
 (0)