1

Here is the code I have:

from web3 import Web3

infura_url = 'https://infura.io/project/MyProjectID'
web3 = Web3(Web3.HTTPProvider(infura_url))

print(web3.isConnected())

The problem is that it returns False and I don't know why. Any ideas what I might do wrong?

1

You must abide by the latest url format. Your code should look as follows:

from web3 import Web3

infura_url = 'mainnet.infura.io/v3/MyProjectID'
web3 = Web3(Web3.HTTPProvider(infura_url))

print(web3.isConnected())

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.