I am trying to connect Optimism-mainnet with web3.py but it always shows False
Here is my script
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://optimism-mainnet.infura.io/v3/{myid}'))
print(w3.isConnected())
{myid}
in above code is just not to expose my real id.
Also, I get this error on trying any query:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://optimism-mainnet.infura.io/v3/{myid}
When I test this with other networks, they work. Only Optimism is not working.
I don’t know why.
I have asked the same question here : Cannot connect Optimism-mainnet Infura with web3.py - Ethereum Stack Exchange
Kindly help