You need to enable JavaScript to run this app. 使用Python爬取WhaleWisdom上Renaissance Technologies持仓表获空数据问题
优惠活动
大模型
产品
解决方案
定价
更多

使用Python爬取WhaleWisdom上Renaissance Technologies持仓表获空数据问题

网页爬取拿到空表格数据的问题

用Python爬取指定页面的持仓表格时,最后拿到的表格内容是空的,提取不到有效数据。
现在用的实现代码如下:

import requests
from bs4 import BeautifulSoup
import lxml.html as lh
from lxml.html.clean import clean_html

url = "https://whalewisdom.com/filer/renaissance-technologies-llc#tabholdings_tab_link"
response = requests.get(url)
print(response)
soup = BeautifulSoup(response.content, 'html.parser')
doc = lh.fromstring(response.content, 'html.parser').xpath("//table[@id='current_holdings_table']")


for i in doc:
  html_data = lh.tostring(i)
  print(html_data)

#soup_table = doc.findAll('table', attrs={'id': 'current_holdings_table'})

跑这段代码的时候,通过XPath定位到ID为current_holdings_table的目标表格,打印出来的表格HTML根本没有持仓相关的有效信息,和网页上正常显示的表格内容对不上,运行结果可以看下面的截图:
运行输出截图


内容的提问来源于stack exchange,提问作者Ramlakhan Kevat

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.11.03 02:06:03