[1] code:python
show
# Import the 'requests' module for making HTTP requests.
import requests
# Define the URL of the web page to be accessed.
url = 'http://www.example.com/'
# Define headers to mimic a user agent (browser) for the request.
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh) Gecko/20100101 Firefox/38.0'}
# Use the 'get' method from the 'requests' module to make an HTTP request to the specified URL with headers.
request = requests.get(url, headers=headers)
# Print the status of the web page request.
print('Web page status: ', request)
# Print HTML code of the web page if the request was successful (status code 200).
print('\nHTML code of the above web page:')
if request.ok:
print(request.text)