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

fdr.StockListing('KRX') 및 HTTP Error 401: Unauthorized 오류 #233

Closed
Lucete28 opened this issue Sep 19, 2024 · 1 comment
Closed

fdr.StockListing('KRX') 및 HTTP Error 401: Unauthorized 오류 #233

Lucete28 opened this issue Sep 19, 2024 · 1 comment

Comments

@Lucete28
Copy link

Lucete28 commented Sep 19, 2024

현재 버전은 다음과 같습니다.

fdr.__version__
'0.9.50'
  1. 다음과 같이 입력시
import FinanceDataReader as fdr

fdr.DataReader('USD/KRW', '2022')
fdr.DataReader('ks11', '2020')

아래와 같은 401에러를 반환합니다.
HTTP Error 401: Unauthorized - symbol "USD/KRW"not found or invalid periods
HTTP Error 401: Unauthorized - symbol "KS11"not found or invalid periods

fdr.StockListing('KRX')

시에도 다음과 같은 문제가 있습니다.
{
"name": "JSONDecodeError",
"message": "Expecting value: line 16 column 3 (char 36)",
"stack": "---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 fdr.StockListing('KRX')

File c:\Users\2580j\AppData\Local\Programs\Python\Python38\lib\site-packages\FinanceDataReader\data.py:69, in StockListing(market)
66 symbol = krx_index_symbol_map[symbol]
67 return KrxIndexReader(symbol, start, end).read()
---> 69 # 1-2) yahoo major indices
70 yahoo_index_symbol_map = {
71 'DJI':'^DJI', 'IXIC':'^IXIC', 'US500':'^GSPC', 'S&P500':'^GSPC',
72 'RUT':'^RUT', 'VIX':'^VIX', 'N225':'^N225', 'SSEC':'000001.SS',
73 'FTSE':'^FTSE', 'HSI':'^HSI', 'FCHI':'^FCHI', 'GDAXI':'^GDAXI',
74 'US5YT':'^FVX', 'US10YT':'^TNX', 'US30YT':'^TYX', # US Treasury Bonds
75 }
76 if symbol in yahoo_index_symbol_map:

File c:\Users\2580j\AppData\Local\Programs\Python\Python38\lib\site-packages\FinanceDataReader\krx\listing.py:16, in read(self)
11 def init(self, market):
12 self.market = market
13 self.headers = {
14 'User-Agent': 'Chrome/78.0.3904.87 Safari/537.36',
15 'Referer': 'http://data.krx.co.kr/'
---> 16 }

File c:\Users\2580j\AppData\Local\Programs\Python\Python38\lib\json\init.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
352 del kw['encoding']
354 if (cls is None and object_hook is None and
355 parse_int is None and parse_float is None and
356 parse_constant is None and object_pairs_hook is None and not kw):
--> 357 return _default_decoder.decode(s)
358 if cls is None:
359 cls = JSONDecoder

File c:\Users\2580j\AppData\Local\Programs\Python\Python38\lib\json\decoder.py:337, in JSONDecoder.decode(self, s, _w)
332 def decode(self, s, _w=WHITESPACE.match):
333 """Return the Python representation of s (a str instance
334 containing a JSON document).
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):

File c:\Users\2580j\AppData\Local\Programs\Python\Python38\lib\json\decoder.py:355, in JSONDecoder.raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 16 column 3 (char 36)"
}

확인해주시면 감사하겠습니다.

@phi-friday
Copy link
Contributor

phi-friday commented Sep 20, 2024

최신 버전을 설치하세요
#230 의 중복입니다

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