I ain't trying to be spoon-fed, but I'm trying to emulate a user-agent, and I can't seem to understand how I can with my code so far, my attempts have failed. (The reason I'm trying to emulate a user-agent, is because I'm being blocked by a(n) 503 Error)
import urllib
import urllib.request
from bs4 import BeautifulSoup
url = "https://website.com/random-junk"
page = urllib.request.urlopen(url)
soup = BeautifulSoup(page, "html.parser")
print(soup.title)
I'm new to Python, so I've been looking into Documents, and other sources that've recommended to me, so if I'm using deprecated methods, or I should do something another way, please tell me! Thanks in advance!