Python Programming - Standard Libraries - Discussion

Discussion Forum : Standard Libraries - General Questions (Q.No. 70)
70.
How can you use the urllib.request module in Python to make an HTTP GET request to a URL?
urllib.get(url)
urllib.urlopen(url)
urllib.request.get(url)
urllib.request.urlopen(url)
Answer: Option
Explanation:
import urllib.request

# Example usage of urllib.request module for making an HTTP GET request
url = 'https://www.example.com'
response = urllib.request.urlopen(url)
content = response.read()
print(content)
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.