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] How to get JSON from webpage into Python script

Discussão em 'Python' iniciado por Stack, Setembro 6, 2025.

  1. Stack

    Stack Membro Participativo

    Got the following code in one of my scripts:

    #
    # url is defined above.
    #
    jsonurl = urlopen(url)

    #
    # While trying to debug, I put this in:
    #
    print jsonurl

    #
    # Was hoping text would contain the actual json crap from the URL, but seems not...
    #
    text = json.loads(jsonurl)
    print text


    What I want to do is get the {{.....etc.....}} stuff that I see on the URL when I load it in Firefox into my script so I can parse a value out of it. I've Googled a ton but I haven't found a good answer as to how to actually get the {{...}} stuff from a URL ending in .json into an object in a Python script.

    Continue reading...

Compartilhe esta Página