Skip to content
New issue

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

webio.py 화일에서 header에 추가하는것이 #207

Open
ikeyada opened this issue Aug 13, 2024 · 3 comments
Open

webio.py 화일에서 header에 추가하는것이 #207

ikeyada opened this issue Aug 13, 2024 · 3 comments

Comments

@ikeyada
Copy link

ikeyada commented Aug 13, 2024

header 에 추가하는게

"Referer": "http://data.krx.co.kr/" 인가요? 아님

"Referer": "http://data.krx.co.kr/contents/MDC/MDI/mdiLoader/index.cmd?menuId=MDC0201020101" 인가요?

pykrx 를 최신버전으로 ('1.0.48') 업데이트 한 이후에도
단순히 stock.get_market_ohlcv 실행했는데, "None of [Index(['시가', '고가', '저가', '종가'], dtype='object')] are in the [columns]" 메세지가 나옵니다. (Issue #182)

@liante0904
Copy link
Contributor

liante0904 commented Aug 20, 2024

print(stock.get_market_ohlcv("20240426", market="KOSPI"))

(venv) root@ideapad-s540:~/dev/pykrx_test# /root/dev/pykrx_test/venv/bin/python /root/dev/pykrx_test/test.py
시가 고가 저가 종가 거래량 거래대금 등락률
티커
095570 4845 4875 4720 4720 77683 369152780 -0.84
006840 14660 14670 14460 14670 9264 134904430 0.07
027410 3730 3740 3710 3740 36617 136349775 0.27
282330 127900 130000 126100 128000 38996 4993467400 -0.78
138930 8350 8490 8310 8390 1261364 10601169080 0.48
... ... ... ... ... ... ... ...
079980 3580 3670 3580 3590 61056 220099680 -0.42
005010 4455 4480 4445 4465 131910 588190820 -0.22
000540 4120 4335 4080 4305 239728 1013396120 4.49
000545 6630 6630 6400 6540 13106 85106340 -1.80
003280 2710 2825 2700 2745 6885764 18941710590 -3.17

잘되는거 같은데요.. 이 함수만 특별히 안되시나요?

@ikeyada
Copy link
Author

ikeyada commented Aug 23, 2024

stock.get_market_ohlcv("20240426", market="KOSPI")
KeyError: "None of [Index(['시가', '고가', '저가', '종가'], dtype='object')] are in the [columns]" _원래 결과 나와야 하는데 결과 안나옵니다._

tickers = stock.get_market_ticker_list("20240823")
print(tickers)
[ ] 원래 나와야 하는데 안나옵니다.

@liante0904
Copy link
Contributor

stock.get_market_ohlcv("20240426", market="KOSPI")

(venv) seunghoon-shinui-MacBook-Air:pykrx seunghoonshin$ /Users/seunghoonshin/dev/pykrx/venv/bin/python /Users/seunghoonshin/dev/pykrx/tests/test.py
1.0.48
시가 고가 저가 종가 거래량 거래대금 등락률
티커
095570 4845 4875 4720 4720 77683 369152780 -0.84
006840 14660 14670 14460 14670 9264 134904430 0.07
027410 3730 3740 3710 3740 36617 136349775 0.27
282330 127900 130000 126100 128000 38996 4993467400 -0.78
138930 8350 8490 8310 8390 1261364 10601169080 0.48
... ... ... ... ... ... ... ...
079980 3580 3670 3580 3590 61056 220099680 -0.42

이것도 잘됩니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants