This task asks you to implement a tiny Python utility using the requests library to fetch a URL and save its HTML to /tmp/page.html.
What you will build
A Python script at /tmp/fetch.py that takes a URL as a command-line argument, fetches the HTML using requests, and writes the raw HTML to /tmp/page.html.
The script should handle errors gracefully and exit with a non-zero status on failure.
How to implement
Ensure Python 3 is available and requests is installed. If needed:
python3 -m pip install --user requests
Create the script /tmp/fetch.py with the following behavior:
Accept exactly one argument: the URL to fetch.
Use requests.get(url, timeout=10) to fetch the page.
If the request succeeds (status code 200), write the response text to /tmp/page.html and print a short success message.
If the request fails or returns a non-200 status, print an error message and exit with a non-zero status.