We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stock_a_congestion_lg接口异常, 报错如下: AttributeError Traceback (most recent call last) Cell In[4], line 5 2 import matplotlib.pyplot as plt 4 # 获取大盘拥挤度数据 ----> 5 stock_a_congestion_lg_df = ak.stock_a_congestion_lg() 7 # 绘制折线图 8 fig, ax1 = plt.subplots(figsize=(20, 8))
File c:\Users\sjyt00001\miniconda3\lib\site-packages\akshare\stock_feature\stock_congestion_lg.py:27, in stock_a_congestion_lg() 22 token = get_token_lg() 23 params = {"token": token} 24 r = requests.get( 25 url, 26 params=params, ---> 27 **get_cookie_csrf(url="https://legulegu.com/stockdata/ashares-congestion") 28 ) 29 data_json = r.json() 30 temp_df = pd.DataFrame(data_json["items"])
File c:\Users\sjyt00001\miniconda3\lib\site-packages\akshare\stock_feature\stock_a_indicator.py:27, in get_cookie_csrf(url) 25 soup = BeautifulSoup(r.text, features="lxml") 26 csrf_tag = soup.find(name="meta", attrs={"name": "_csrf"}) ---> 27 csrf_token = csrf_tag.attrs["content"] 28 headers = {"X-CSRF-Token": csrf_token} 29 return {"cookies": r.cookies, "headers": headers}
AttributeError: 'NoneType' object has no attribute 'attrs'
The text was updated successfully, but these errors were encountered:
stock_a_congestion_lg
接口正常
Sorry, something went wrong.
No branches or pull requests
stock_a_congestion_lg接口异常, 报错如下:
AttributeError Traceback (most recent call last)
Cell In[4], line 5
2 import matplotlib.pyplot as plt
4 # 获取大盘拥挤度数据
----> 5 stock_a_congestion_lg_df = ak.stock_a_congestion_lg()
7 # 绘制折线图
8 fig, ax1 = plt.subplots(figsize=(20, 8))
File c:\Users\sjyt00001\miniconda3\lib\site-packages\akshare\stock_feature\stock_congestion_lg.py:27, in stock_a_congestion_lg()
22 token = get_token_lg()
23 params = {"token": token}
24 r = requests.get(
25 url,
26 params=params,
---> 27 **get_cookie_csrf(url="https://legulegu.com/stockdata/ashares-congestion")
28 )
29 data_json = r.json()
30 temp_df = pd.DataFrame(data_json["items"])
File c:\Users\sjyt00001\miniconda3\lib\site-packages\akshare\stock_feature\stock_a_indicator.py:27, in get_cookie_csrf(url)
25 soup = BeautifulSoup(r.text, features="lxml")
26 csrf_tag = soup.find(name="meta", attrs={"name": "_csrf"})
---> 27 csrf_token = csrf_tag.attrs["content"]
28 headers = {"X-CSRF-Token": csrf_token}
29 return {"cookies": r.cookies, "headers": headers}
AttributeError: 'NoneType' object has no attribute 'attrs'
The text was updated successfully, but these errors were encountered: