python-3.x - 本网站(nseindia.com)的动态数据未导入 python pandas
问题描述
网站链接:https ://www.nseindia.com/products/content/equities/equities/eq_security.htm
import requests
import pandas as pd
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"X-Requested-With": "XMLHttpRequest"
}
r = requests.get('https://www.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp?symbol=TCS&segmentLink=3&symbolCount=2&series=ALL&dateRange=+&fromDate=13-12-2019&toDate=18-12-2019&dataType=PRICEVOLUMEDELIVERABLE', headers=headers)
df = pd.read_html(r.text)
print(df)
我已经尝试过编写代码,但它给了我这个错误ValueError: No tables found
解决方案
推荐阅读
- c++ - 使用 SDL_QUIT 事件时程序崩溃?
- xslt - 将 2 个过滤后的数字相乘并求和
- rest - REST API 的 Golang 测试转储整个数据库
- python - 如何获得数字的半精度浮点表示?
- c# - 如何在 C# 中使字符串输入不区分大小写?
- python - 如何为 tpu 的多个输入提供 Tensorflow 的数据?
- sql - SQL WHERE 子句中的无效位置
- python - 我可以将 source_directory 参数指向 Azure blob 存储吗?
- python - Is there a way to find out if Python threading locks are ever used by more than one thread?
- java - 在春季使用多个服务/控制器