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

urllib3.exceptions.HostChangedError: HTTPConnectionPool(host='mis.tse.com.tw', port=None) #35

Open
snowuyl opened this issue Oct 22, 2016 · 1 comment

Comments

@snowuyl
Copy link

snowuyl commented Oct 22, 2016

Dear toomore,
I added test.py to get real time stock price of 2618.
from grs import RealtimeTWSE

realtime_stock = RealtimeTWSE('2618')
realtime_stock.raw
realtime_stock.data

But when I type the following on terminal of Ubuntu 16.04. The following error occurred.
Traceback (most recent call last):
File "test.py", line 3, in
realtime_stock = RealtimeTWSE('2618')
File "/home/snowuyl/samba/grs-master/grs/realtime2.py", line 132, in init
super(RealtimeTWSE, self).init(no, date)
File "/home/snowuyl/samba/grs-master/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 69, in request
*_urlopen_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/request.py", line 90, in request_encode_url
return self.urlopen(method, url, *_extra_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 654, in urlopen
release_conn=release_conn, **response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 531, 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.8

Do you have any suggestion to solve this issue?

Thanks in advance!

snowuyl

@yhsiang
Copy link

yhsiang commented Nov 30, 2016

this duplicate with #25 and #40 will solve this!

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