用于抓取 etherscan 交易块 ID 的代码
def block_chain_explorer_block_id(url):
import requests
from bs4 import BeautifulSoup
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html5lib')
tags = soup.findAll('div', attrs = {'class':'col-md-9'})
print(soup.findAll('a'))
block_chain_explorer_block_id(https://etherscan.io/tx/0x4529e9f79139edab871a699df455e57101cca90574e435da89db457df4885c54)
输出得到:
[<a href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" rel="noopener noreferrer" target="_blank">Cloudflare</a>]
我得到高于输出polygonscan
工作正常。etherscan 工作正常。知道如何使它工作吗?