Traceback (most recent call last):
File "realtime2.py", line 235, in
realtime_data = RealtimeTWSE(1201)
File "realtime2.py", line 132, in init
super(RealtimeTWSE, self).init(no, date)
File "realtime2.py", line 35, in init
self.result = URL.request('GET', STOCKPATH % params)
File "/usr/lib/python2.7/site-packages/urllib3/request.py", line 69, in request
*_urlopen_kw)
File "/usr/lib/python2.7/site-packages/urllib3/request.py", line 90, in request_encode_url
return self.urlopen(method, url, *_extra_kw)
File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 652, in urlopen
release_conn=release_conn, **response_kw)
File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 529, in urlopen
raise HostChangedError(self, url, retries)
urllib3.exceptions.HostChangedError: HTTPConnectionPool(host='mis.tse.com.tw', port=None): Tried to open a foreign host with url: http://1.1.1.2
我也有這種問題
Traceback (most recent call last):
File "get_grs.py", line 3, in
realtime_stock = RealtimeOTC('8446')
File "/usr/local/lib/python2.7/dist-packages/grs/realtime2.py", line 146, in init
super(RealtimeOTC, self).init(no, date)
File "/usr/local/lib/python2.7/dist-packages/grs/realtime2.py", line 35, in init
self.result = URL.request('GET', STOCKPATH % params)
File "/usr/lib/python2.7/dist-packages/urllib3/request.py", line 75, in request
*_urlopen_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/request.py", line 88, in request_encode_url
return self.urlopen(method, url, *_urlopen_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
release_conn=release_conn, *_response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 551, in urlopen
raise HostChangedError(self, url, retries - 1)
urllib3.exceptions.HostChangedError: HTTPConnectionPool(host='mis.tse.com.tw', port=None): Tried to open a foreign host with url: http://1.1.1.2
nelson@cbn-Veriton-M265:~/git/Python_Teach/get_stock_information$ python get_grs.py
Traceback (most recent call last):
File "get_grs.py", line 3, in
realtime_stock = RealtimeOTC('8446')
File "/usr/local/lib/python2.7/dist-packages/grs/realtime2.py", line 146, in init
super(RealtimeOTC, self).init(no, date)
File "/usr/local/lib/python2.7/dist-packages/grs/realtime2.py", line 35, in init
self.result = URL.request('GET', STOCKPATH % params)
File "/usr/lib/python2.7/dist-packages/urllib3/request.py", line 75, in request
*_urlopen_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/request.py", line 88, in request_encode_url
return self.urlopen(method, url, *_urlopen_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
release_conn=release_conn, *_response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 551, in urlopen
raise HostChangedError(self, url, retries - 1)
urllib3.exceptions.HostChangedError: HTTPConnectionPool(host='mis.tse.com.tw', port=None): Tried to open a foreign host with url: http://1.1.1.2
Source code
`
from grs import RealtimeOTC
realtime_stock = RealtimeOTC('8446')
realtime_stock.raw
realtime_stock.data
`
I met the same problem when I used the realtimeTWSE.
The error information is as below:
File "/Library/Python/2.7/site-packages/grs-0.6.2-py2.7.egg/grs/realtime2.py", line 132, in init
super(RealtimeTWSE, self).init(no, date)
File "/Library/Python/2.7/site-packages/grs-0.6.2-py2.7.egg/grs/realtime2.py", line 35, in init
self.result = URL.request('GET', STOCKPATH % params)
File "build/bdist.macosx-10.11-intel/egg/urllib3/request.py", line 69, in request
File "build/bdist.macosx-10.11-intel/egg/urllib3/request.py", line 90, in request_encode_url
File "build/bdist.macosx-10.11-intel/egg/urllib3/connectionpool.py", line 675, in urlopen
File "build/bdist.macosx-10.11-intel/egg/urllib3/connectionpool.py", line 544, in urlopen
urllib3.exceptions.HostChangedError: HTTPConnectionPool(host='mis.tse.com.tw', port=80): Tried to open a foreign host with url: http://1.1.1.2
Does anyone know what's going on with it?