Micro-sheep / Micro-sheep/efinance
第一次访问,连接不上
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.1k
- Forks
- 755
- PR merge metrics
- No merged PRs in 30d
Description
第一次使用efinance,根据Demo读股票K线数据,发现连接不上。
代码:ef.stock.get_quote_history('600519')
报错信息:
File "c:\github\shwdbd\feedme\venv\lib\site-packages\efinance\stock\getter.py", line 233, in get_quote_history
df = get_quote_history_for_stock(
File "c:\github\shwdbd\feedme\venv\lib\site-packages\efinance\common\getter.py", line 202, in get_quote_history
return get_quote_history_single(codes,
File "c:\github\shwdbd\feedme\venv\lib\site-packages\efinance\utils_init_.py", line 37, in run
values = func(*args, **kwargs)
File "c:\github\shwdbd\feedme\venv\lib\site-packages\efinance\common\getter.py", line 85, in get_quote_history_single
quote_id = get_quote_id(code)
File "C:\Python\Anaconda3\lib\site-packages\decorator.py", line 231, in fun
return caller(func, *(extras + args), **kw)
File "c:\github\shwdbd\feedme\venv\lib\site-packages\retry\api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "c:\github\shwdbd\feedme\venv\lib\site-packages\retry\api.py", line 33, in retry_internal
return f()
File "c:\github\shwdbd\feedme\venv\lib\site-packages\efinance\utils_init.py", line 86, in get_quote_id
quote = search_quote(stock_code)
File "c:\github\shwdbd\feedme\venv\lib\site-packages\efinance\utils_init.py", line 125, in search_quote
json_response = session.get(url, params=params).json()
File "C:\Python\Anaconda3\lib\site-packages\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Python\Anaconda3\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python\Anaconda3\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Python\Anaconda3\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Python\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Python\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Python\Anaconda3\lib\site-packages\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Python\Anaconda3\lib\site-packages\urllib3\connection.py", line 500, in connect_tls_proxy
return ssl_wrap_socket(
File "C:\Python\Anaconda3\lib\site-packages\urllib3\util\ssl.py", line 432, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "C:\Python\Anaconda3\lib\site-packages\urllib3\util\ssl.py", line 474, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Python\Anaconda3\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Python\Anaconda3\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing ef.stock.get_quote_history('600519') and inspect the traceback through efinance/stock/getter.py, efinance/common/getter.py, and efinance/utils/init.py, especially search_quote. Check whether the failure depends on the proxy or TLS environment shown in the traceback. Done means the documented first-use example connects successfully and returns the stock history data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100