Created
May 10, 2023 18:06
-
-
Save KC2016/a5ce38d4e1bb9adf259f41d8b01e70ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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