'i try to get url and id using python but mu code can;t do this plzz anyone solve this

I'm trying to get url and id using python, but my code can't do this:

from requests import get
# from selenium import webdriver
import requests
# url = requests.GET.get('id')

def get_real_url_from_shortlink(url):
    resp = requests.get(url)
    return resp.url


Solution 1:[1]

It might just be the formatting on this site but your indentation is incorrect. you should have :

def get_real_url_from_shortlink(url):
    resp = requests.get(url)
    return resp.url

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gchapuis