Skip to content

Commit e4b0e9d

Browse files
committed
[Fix] Token specific check before replacing
Was saving to a 0 len array to nonexistent column
1 parent 361121d commit e4b0e9d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def getLabel(label, label_type="account", input_type='single'):
8181
if (href.startswith(baseUrl + '/address/')):
8282
addressList.append(href[addrIndex:])
8383
elif href.startswith(baseUrl + '/token/'):
84-
84+
#print('elem.text:',elem.text)
8585
if '...' in elem.text:
8686
#try:
8787
# Check if the element has the tooltip attribute
@@ -109,9 +109,12 @@ def getLabel(label, label_type="account", input_type='single'):
109109

110110
# Quickfix: Optimism uses etherscan subcat style but differing address format
111111
if targetChain == 'eth':
112+
#print('addressList',addressList)
112113
# Replace address column in newTable dataframe with addressList
113114
curTable['Address'] = addressList
114-
curTable['Token Name'] = tokenNameList
115+
116+
# Replace with Token Name only if it exists
117+
if len(tokenNameList): curTable['Token Name'] = tokenNameList
115118
except Exception as e:
116119
print(e)
117120
print(label, "Skipping label due to error")

0 commit comments

Comments
 (0)