I am trying to subscribe to pending transactions on the Ethereum blockchain using this tutorial from Infura: https://docs.infura.io/tutorials/ethereum/subscribe-to-pending-transactions
When I try to execute the .py file in Terminal it reads:
''' websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 401 '''
I am very unfamiliar with Python and Infura websockets. What is the problem with my code and how can I correct it?
infura_ws_url
. It worked as expected for me!