在Python中,可以使用urllib.parse庫中的unquote函數來進行URL解碼。下面是一個簡單的示例代碼:
from urllib.parse import unquote
url = "https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3Dpython%26rlz%3D1C1GCEU_en%26oq%3Dpython%26aqs%3Dchrome..69i57j69i60l3j69i65j69i60.1242j0j4%26sourceid%3Dchrome%26ie%3DUTF-8"
decoded_url = unquote(url)
print(decoded_url)
運行以上代碼會輸出以下結果:
https://www.google.com/search?q=python&rlz=1C1GCEU_en&oq=python&aqs=chrome..69i57j69i60l3j69i65j69i60.1242j0j4&sourceid=chrome&ie=UTF-8