【发布时间】:2021-08-10 03:51:05
【问题描述】:
我正在尝试从以下位置抓取整个数据表: https://coinmarketcap.com/currencies/ethereum/historical-data/
我正在尝试提取表格:
<table class="h7vnx2-2 jNaLNi cmc-table ">
与
table = soup.find('table', {"class":"h7nvx2-2 jNaLNi cmc-table"})
它返回:无
这是完整的代码:
import requests
from bs4 import BeautifulSoup
def main():
URL = "https://coinmarketcap.com/currencies/ethereum/historical-data/"
page = requests.get(URL)
soup = BeautifulSoup(page.content, "html.parser")
table = soup.find('table', {"class":"h7nvx2-2 jNaLNi cmc-table"})
print(table)
if __name__ == "__main__":
main()
【问题讨论】:
-
如果是动态生成的,您是否尝试查找 Etherium 的历史数据
标签: beautifulsoup