소스 검색

add time sleep

Rony 3 년 전
부모
커밋
43fe23d19c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      bsc_token_price.py

+ 2 - 0
bsc_token_price.py

@@ -51,6 +51,7 @@ def getPrice(contract):
     response = requests.get(f'https://deep-index.moralis.io/api/v2/erc20/{contract}/price', headers=headers,
                             params=params)
     result = response.json()
+    print(result)
     usdPrice = result['usdPrice']
     bnbPrice = int(result['nativePrice']['value'])/1000000000000000000
     try:
@@ -65,6 +66,7 @@ def getAllPrice():
     bnbPrice = 0
     tokenList = getTokenList()
     for i in tokenList:
+        time.sleep(1)
         info, bnb = getPrice(i)
         l.append(info)
         if bnb != 0: