Skip to content

Instantly share code, notes, and snippets.

@KC2016
Created May 10, 2023 18:06
Show Gist options
  • Save KC2016/a5ce38d4e1bb9adf259f41d8b01e70ee to your computer and use it in GitHub Desktop.
Save KC2016/a5ce38d4e1bb9adf259f41d8b01e70ee to your computer and use it in GitHub Desktop.
import urllib.parse
import requests
import urllib.parse
from urllib.parse import urlparse
url_search = 'https://geofree.pythonanywhere.com/api/get-categories/'
response2 = requests.get(url_search)
parsed_url = urlparse(url_search)
path = parsed_url.path
get_categories = response2.json()
get_categories
chosen_category = get_categories[0]['name']
chosen_category
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment