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

Python HTTP Error - 403 Forbidden #1

Closed
greatathrun opened this issue Jan 8, 2018 · 9 comments
Closed

Python HTTP Error - 403 Forbidden #1

greatathrun opened this issue Jan 8, 2018 · 9 comments

Comments

@greatathrun
Copy link

I'm trying to open up this website using python urllib2 but I keep getting a 403 error. Can someone guide me with this error?did you have the same problem

@khuangaf
Copy link
Owner

khuangaf commented Jan 9, 2018

Can you post the error message? What version of python are you using?

@greatathrun
Copy link
Author

greatathrun commented Jan 21, 2018 via email

@macd2
Copy link

macd2 commented Feb 5, 2018

Hello,
i just installed your project and have the same error but when running the "DataCollection.ipynb" in jupyter than i get

HTTPError                                 Traceback (most recent call last)
<ipython-input-2-edc757a0182e> in <module>()
      3 for coin in coins:
      4     url = 'https://poloniex.com/public?command=returnChartData&currencyPair=USDT_'+coin+'&start=1439014500&end=9999999999&period=300'
----> 5     openUrl = urllib2.urlopen(url)
      6     r = openUrl.read()
      7     openUrl.close()

/usr/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    152     else:
    153         opener = _opener
--> 154     return opener.open(url, data, timeout)
    155 
    156 def install_opener(opener):

/usr/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout)
    433         for processor in self.process_response.get(protocol, []):
    434             meth = getattr(processor, meth_name)
--> 435             response = meth(req, response)
    436 
    437         return response

/usr/lib/python2.7/urllib2.pyc in http_response(self, request, response)
    546         if not (200 <= code < 300):
    547             response = self.parent.error(
--> 548                 'http', request, response, code, msg, hdrs)
    549 
    550         return response

/usr/lib/python2.7/urllib2.pyc in error(self, proto, *args)
    471         if http_err:
    472             args = (dict, 'default', 'http_error_default') + orig_args
--> 473             return self._call_chain(*args)
    474 
    475 # XXX probably also want an abstract factory that knows when it makes

/usr/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, *args)
    405             func = getattr(handler, meth_name)
    406 
--> 407             result = func(*args)
    408             if result is not None:
    409                 return result

/usr/lib/python2.7/urllib2.pyc in http_error_default(self, req, fp, code, msg, hdrs)
    554 class HTTPDefaultErrorHandler(BaseHandler):
    555     def http_error_default(self, req, fp, code, msg, hdrs):
--> 556         raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    557 
    558 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden

@khuangaf
Copy link
Owner

khuangaf commented Feb 5, 2018

@khuangaf khuangaf closed this as completed Feb 6, 2018
@macd2
Copy link

macd2 commented Feb 6, 2018

its exactly the same URL and returns same error.
url = 'https://poloniex.com/public?command=returnChartData&currencyPair=USDT_'+coin+'&start=1439014500&end=9999999999&period=300'
in the call it looks like this:
url = 'https://poloniex.com/public?command=returnChartData&currencyPair=USDT_ETH&start=1356998100&end=9999999999&period=300'

@khuangaf
Copy link
Owner

khuangaf commented Feb 6, 2018 via email

@macd2
Copy link

macd2 commented Feb 6, 2018

can i also use the one from Bittrex or an other exchange?
https://bittrex.com/home/api

@khuangaf
Copy link
Owner

khuangaf commented Feb 6, 2018 via email

@macd2
Copy link

macd2 commented Feb 6, 2018

would you mind to implement this?
many thanks!

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

3 participants