FinanceData / FinanceDataReader

Financial data reader
1.1k stars 356 forks source link

HTTPSConnectionPool(host='iappapi.investing.com', port=443): Max retries exceeded with url 오류가 저만 발생한 것일까요? #158

Closed WonSeokChoi-Unicorn closed 1 year ago

WonSeokChoi-Unicorn commented 1 year ago

9월 29일 23시쯤에는 문제 없이 실행되었는데

어제(9월 30일) 23시에는 실행이 안 되어서 로그 확인해보니 아래와 같습니다.

investing.com의 정책 변화가 있는 것일까요?

Traceback (most recent call last): File "C:\Python38\lib\site-packages\urllib3\connection.py", line 174, in _new_conn conn = connection.create_connection( File "C:\Python38\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "C:\Python38\lib\socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python38\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "C:\Python38\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "C:\Python38\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn conn.connect() File "C:\Python38\lib\site-packages\urllib3\connection.py", line 358, in connect conn = self._new_conn() File "C:\Python38\lib\site-packages\urllib3\connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x00000189240B4910>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Python38\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\Python38\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen retries = retries.increment( File "C:\Python38\lib\site-packages\urllib3\util\retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='iappapi.investing.com', port=443): Max retries exceeded with url: /get_screen.php?lang_ID=51&skinID=2&interval=day&time_utc_offset=7200&screen_ID=63&pair_ID=518&date_from=29092022&date_to=29092022 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000189240B4910>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:\Dropbox\Document\Programming\Project\Python\UnicornPython\StockAuto\StockAIWithSlacktoDB_CWS.py", line 476, in us_before1daydf = fdr.DataReader(stock6, us_beforeday1.strftime('%Y%m%d'), us_beforeday1.strftime('%Y%m%d')) File "C:\Python38\lib\site-packages\FinanceDataReader\data.py", line 41, in DataReader df = reader(symbol, start, end, exchange, data_source).read() File "C:\Python38\lib\site-packages\FinanceDataReader\investing\data.py", line 63, in read r = requests.get(url, headers={ 'X-Meta-Ver': '14', 'User-Agent': 'Mozilla/5.0' }, timeout=3) File "C:\Python38\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "C:\Python38\lib\site-packages\requests\api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "C:\Python38\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "C:\Python38\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, kwargs) File "C:\Python38\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='iappapi.investing.com', port=443): Max retries exceeded with url: /get_screen.php?lang_ID=51&skinID=2&interval=day&time_utc_offset=7200&screen_ID=63&pair_ID=518&date_from=29092022&date_to=29092022 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000189240B4910>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))

이 글 저장하기 전에 실행해보니, 정상이네요 ^^;

잠시 문제가 된 것인지?

FinanceData commented 1 year ago

Cloudflare 제약 문제를 포함하여 상당부분 문제가 0.9.40 에서 해결되었습니다. (해결이라기 보다 우회라고 하는 것이 맞을 것 같습니다)

https://github.com/financedata-org/FinanceDataReader/wiki/Release-Note-0.9.40

Cloudflare 제약 문제 등 때문에 점진적으로 investing 외에 다른 데이터 소스를 검토하고 있습니다. 이후에도 문제가 된다면 다시 알려주시면 감사합니다.

WonSeokChoi-Unicorn commented 1 year ago

Cloudflare 제약 문제를 포함하여 상당부분 문제가 0.9.40 에서 해결되었습니다. (해결이라기 보다 우회라고 하는 것이 맞을 것 같습니다)

https://github.com/financedata-org/FinanceDataReader/wiki/Release-Note-0.9.40

Cloudflare 제약 문제 등 때문에 점진적으로 investing 외에 다른 데이터 소스를 검토하고 있습니다. 이후에도 문제가 된다면 다시 알려주시면 감사합니다.

아래 #157 이슈에 대해서는 확인 중이신가요?

FinanceData commented 1 year ago

Release 0.9.50 에서 FIX 하였습니다. 상세한 내용을 아래 Release Note 참고하시기 바랍니다.

https://github.com/financedata-org/FinanceDataReader/wiki/Release-Note-0.9.50

WonSeokChoi-Unicorn commented 1 year ago

Release 0.9.50 에서 FIX 하였습니다. 상세한 내용을 아래 Release Note 참고하시기 바랍니다.

https://github.com/financedata-org/FinanceDataReader/wiki/Release-Note-0.9.50

완성하시느라 수고 많으셨습니다.

감사합니다.