Skip to content

Commit

Permalink
fix: fix stock_history_dividend
Browse files Browse the repository at this point in the history
  • Loading branch information
albertandking committed Oct 2, 2024
1 parent 963ea7a commit cc1dbba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
7 changes: 4 additions & 3 deletions akshare/stock_fundamental/stock_finance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2024/6/7 22:00
Date: 2024/10/2 9:00
Desc: 股票基本面数据
新浪财经-财务报表-财务摘要
https://vip.stock.finance.sina.com.cn/corp/go.php/vFD_FinanceSummary/stockid/600004.phtml
Expand All @@ -17,6 +17,7 @@
import pandas as pd
import requests
from bs4 import BeautifulSoup

from akshare.utils.tqdm import get_tqdm


Expand Down Expand Up @@ -257,12 +258,12 @@ def stock_financial_analysis_indicator(
def stock_history_dividend() -> pd.DataFrame:
"""
新浪财经-发行与分配-历史分红
https://vip.stock.finance.sina.com.cn/q/go.php/vInvestConsult/kind/lsfh/index.phtml?p=1&num=5000
https://vip.stock.finance.sina.com.cn/q/go.php/vInvestConsult/kind/lsfh/index.phtml
:return: 所有股票的历史分红数据
:rtype: pandas.DataFrame
"""
url = "https://vip.stock.finance.sina.com.cn/q/go.php/vInvestConsult/kind/lsfh/index.phtml"
params = {"p": "1", "num": "5000"}
params = {"p": "1", "num": "50000"}
r = requests.get(url, params=params)
temp_df = pd.read_html(StringIO(r.text))[0]
temp_df["代码"] = temp_df["代码"].astype(str).str.zfill(6)
Expand Down
27 changes: 14 additions & 13 deletions docs/data/stock/stock.md
Original file line number Diff line number Diff line change
Expand Up @@ -11661,7 +11661,7 @@ print(stock_financial_hk_analysis_indicator_em_df)

接口: stock_history_dividend

目标地址: http://vip.stock.finance.sina.com.cn/q/go.php/vInvestConsult/kind/lsfh/index.phtml?p=1&num=5000
目标地址: http://vip.stock.finance.sina.com.cn/q/go.php/vInvestConsult/kind/lsfh/index.phtml

描述: 新浪财经-发行与分配-历史分红

Expand Down Expand Up @@ -11698,18 +11698,19 @@ print(stock_history_dividend_df)
数据示例

```
代码 名称 上市日期 累计股息 年均股息 分红次数 融资总额 融资次数
0 000550 江铃汽车 1993-12-01 198.9 7.10 45 0.0000 0
1 000541 佛山照明 1993-11-23 178.6 6.38 50 0.0000 0
2 000726 鲁泰A 2000-12-25 134.6 6.41 41 9.5082 1
3 000429 粤高速A 1998-02-20 133.0 5.54 44 16.3350 1
4 000022 深赤湾A 1993-05-05 132.3 5.09 45 0.0000 0
... ... ... ... ... ... ... ...
4605 688789 宏华数科 2021-07-08 0.0 0.00 0 5.0340 1
4606 688798 艾为电子 2021-08-16 0.0 0.00 0 30.3526 1
4607 688799 华纳药厂 2021-07-13 0.0 0.00 0 6.5566 1
4608 688800 瑞可达 2021-07-22 0.0 0.00 0 3.4983 1
4609 688981 中芯国际 2020-07-16 0.0 0.00 0 525.1560 1
代码 名称 上市日期 累计股息 年均股息 分红次数 融资总额 融资次数
0 000550 江铃汽车 1993-12-01 213.0 6.87 51 0.0000 0
1 000541 佛山照明 1993-11-23 192.0 6.19 56 10.8842 1
2 000429 粤高速A 1998-02-20 171.4 6.35 50 16.3350 1
3 000726 鲁泰A 2000-12-25 143.9 6.00 47 9.5082 1
4 000581 威孚高科 1998-09-24 143.1 5.50 48 28.5012 1
... ... ... ... ... ... ... ... ...
5556 920002 万达轴承 2024-05-30 0.0 0.00 0 1.0235 1
5557 920008 成电光信 2024-08-29 0.0 0.00 0 0.8949 1
5558 920016 中草香料 2024-09-13 0.0 0.00 0 1.1465 1
5559 920099 瑞华技术 2024-09-25 0.0 0.00 0 0.0000 0
5560 920118 太湖远大 2024-08-22 0.0 0.00 0 0.0000 0
[5561 rows x 8 columns]
```

#### 十大流通股东(个股)
Expand Down

0 comments on commit cc1dbba

Please sign in to comment.