'websocket-client python no data from the binance api
I had the problem that the websocket didn't respond and there was no data coming. Empty terminal without anything printed out.
I downgraded the python websocket-client to 0.57.0 version and now I am getting 'close' printed out but still no messages coming in.
I have no idea about what is wrong. Any clue why?
import websocket
cc = 'btcusdt'
interval = '1m'
socket = f'wss://stream.binance.com:9443/ws/{cc}@kline_{interval}'
def on_close(ws):
print('close')
def on_message(ws, message):
print('message')
print(message)
ws = websocket.WebSocketApp(
socket,
on_message=on_message,
on_close=on_close)
websocket.enableTrace(True)
ws.run_forever()
Solution 1:[1]
this worked for me ... it printed messages you might have in import problem, try reinstalling python with all the packages, or make sure you are using the correct
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | notsaggin |
