首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何通过Python从url中提取特定的表?

如何通过Python从url中提取特定的表?
EN

Stack Overflow用户
提问于 2022-06-10 21:19:40
回答 2查看 42关注 0票数 0

我现正研究以下连结:

https://www.ishares.com/de/privatanleger/de/produkte/251931/ishares-stoxx-europe-600-ucits-etf-de-fund

有一个表显示ETF的所有位置。我的目标是提取表并将其保存到xlsx文件中。我写了一个代码:

代码语言:javascript
复制
import requests
import pandas as pd

url = 'https://www.ishares.com/de/privatanleger/de/produkte/251931/ishares-stoxx-europe-600-ucits-etf-de-fund'
html = requests.get(url).content
df_list = pd.read_html(html)
df = df_list[-1]
print(df)
df.to_excel('my data.xlsx')

然而,当我尝试pd.read_html(html)时,它总是告诉我在网站上找不到任何表格。有人知道如何通过Python识别和提取所需的表吗?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72579944

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档