12
Follow
57
Followers
Tôi đã thử đọc thông tin trực tiếp từ sàn giao dịch, và đây là mã:
from urllib import request
def fetch_url_data(url):
try:
req = request.urlopen{url).read{).decode{'utf-8') # request{url}{GET}
return json.loads(req)
except Exception as e:
print ((' giao diện giao dịch phát hiện lỗi:', e)
url = "https://www.okex.me/api/spot/v3/instruments"
data = fetch_url_data(url)
Các nhà nghiên cứu đã có thể đọc được dữ liệu, nhưng khi truy cập vào phản hồi, họ nhận được thông báo lỗi như sau:
urllib.error.URLError: <urlopen error [Errno 111] Connection refused
Tôi đã nghiên cứu trong nửa ngày, có người nói rằng máy chủ đã thiết lập proxy, có người nói rằng Python3 đã thay đổi cách sử dụng thư viện urllib, xin vui lòng nói với Chúa là điều gì.
Related Recommendations
Advanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?5.5 Trading strategy optimization
Comment
All comments (5)
- 1
