I am trying to open the Instagram URL using urllib.request.urlopen(url).read() but I am getting the error urllib.error.HTTPError: HTTP Error 502: Bad Gateway
username = input('enter the username - ')
url = "https://www.instagram.com/{}".format(username)
html = urllib.request.urlopen(url).read()
soup = BeautifulSoup(html, 'html.parser')
How can I solve this issue?
EDIT: I got the solution and I have posted it. Cheers :)
username?