The resource loading... loading...

Error linking to a timesheet using urllib to read exchange information

Author: congcong009, Created: 2019-12-22 09:16:42, Updated:

I tried to read directly from the exchange, and the code was:

from urllib import request Def fetch_url_data ((url): try: req = request.urlopen ((url).read (().decode ((utf-8) # request url ((GET request)) return json.loads ((req)) except Exception as e: print (Error detection of the exchange interface: , e) url = What?https://www.okex.me/api/spot/v3/instruments” data = fetch_url_data(url)

The data can be read in the research center, but when accessed for retesting, the error is as follows:

urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

I've been researching for half a day, some say the server has set up proxies, some say python3 has changed the use of the urllib library, please God, what is going on.


More

catcatfishThe grid is supporting bigone?

The grassDomestic server not accessible

congcong009FMZ support

The grassWell, the retest is not connected, so you should understand why.

congcong009It's a problem with the backtest system, it's a sandbox mode, can't access offline, I did a real-time test and it's ok ^^