Форум сайта python.su
Доброе время суток,
Написал такой код что попробовать использование библиотеки web3:
from web3 import Web3 binance_testnet_rpc_url = "https://data-seed-prebsc-1-s1.binance.org:8545/" #https://data-seed-prebsc-1-s1.binance.org:8545/ web3 = Web3(Web3.HTTPProvider(binance_testnet_rpc_url)) print(web3) print(f"Is connected: {web3.isConnected()}") # Is connected: True # С подключением вас
/usr/local/lib/python3.8/dist-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.15) or chardet (2.3.0)/charset_normalizer (3.1.0) doesn't match a supported version!
warnings.warn(
<web3.main.Web3 object at 0x7fb34d2560d0>
Traceback (most recent call last):
File “testWeb3.py”, line 9, in <module>
print(f“Is connected: {web3.isConnected()}”) # Is connected: True
AttributeError: ‘Web3’ object has no attribute ‘isConnected’
Офлайн
Решен вопрос
print(f“Is connected: {web3.is_connected()}”) # Is connected: True
Офлайн