Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Python - getting info from a url from with returned results

  • 24-10-2018 1:33pm
    #1
    Registered Users, Registered Users 2 Posts: 10,770 ✭✭✭✭


    Hi - Im teaching myself some python and I'm stuck.

    I can pull info back from an API, but within that info is another set of urls, from which I need further data. If I use this:
    import requests
    url = "https://pokeapi.co/api/v2/pokemon-color/"
    data = requests.get(url)
    parsed_data = data.json()
    pokemon_types = parsed_data['results']
    for p_type in pokemon_types:
        url = ['results']['url']
    

    .. it'll print the resulting colour name and url which then has further data. I cant figure out how to pull more data from the urls and print that, rather than the url itself. i know how to separate the data that I need to get from the urls, but I dont know how to open those urls, so i can search and then print what I need. Anyone have an pointers or anything online to help me figure it out?


Comments

Advertisement