import urllib.request
def get_site_html(url):
source = urllib.request.urlopen(url).read()
return source
I am trying to create this function but it throws me the below error--
HTTPError: HTTP Error 404: Not Found
Please help me with this.
import urllib.request
req = urllib.request.Request('your link here')
with urllib.request.urlopen(req) as response:
the_page = response.read()