12
Follow
57
Followers
एक्सचेंज जानकारी पढ़ने के लिए urllib का उपयोग करते समय कनेक्शन त्रुटि
Created 2019-12-22 09:16:42
5
1652
मैंने एक्सचेंजों के संदेशों को सीधे पढ़ने की कोशिश की, और कोड इस प्रकार है।
from urllib import request
def fetch_url_data(url):
try:
req = request.urlopen{url).read{).decode{'utf-8') # अनुरोध url{GET अनुरोध)
return json.loads(req)
except Exception as e:
print ((' एक्सचेंज इंटरफ़ेस में त्रुटि का पता चला:', e)
url = "https://www.okex.me/api/spot/v3/instruments"
data = fetch_url_data(url)
इस तरह से, यह डेटा को पढ़ने के लिए सक्षम है, लेकिन जब हम इसे एक्सेस करते हैं, तो यह त्रुटि आती हैः
urllib.error.URLError: <urlopen error [Errno 111] Connection refused
मैंने आधे दिन अध्ययन किया, कुछ ने कहा कि सर्वर ने एक एजेंट स्थापित किया है, कुछ ने कहा कि पायथन 3 ने urllib लाइब्रेरी का उपयोग किया है, कृपया महादेव से पूछें कि यह क्या है . . .
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
