1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] https get request with python urllib2

Discussão em 'Python' iniciado por Stack, Julho 1, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to fetch data from quandl using urllib2.Please check code below.

    import json
    from pymongo import MongoClient
    import urllib2
    import requests
    import ssl
    #import quandl
    codes = [100526];
    for id in codes:
    url = 'https://www.quandl.com.com//api/v3/datasets/AMFI/"+str(id)+".json?api_key=XXXXXXXX&start_date=2013-08-30'
    req = urllib2.Request(url)
    response = urllib2.urlopen(req)
    data = response.read()
    print data


    OR

    for id in codes:
    url = "https://www.quandl.com.com//api/v3/datasets/AMFI/"+str(id)+".json?api_key=XXXXXXXX&start_date=2013-08-30"
    request = requests.get(url,verify=False)
    print request


    I am getting HTTPERROR exception 404 in 1st case. and when I use request module I get SSL error even after using verify=false. I am looking through previous posts but most of them are related to HTTP request.

    Continue reading...

Compartilhe esta Página