Handling HTTP requests with Python in a Jupyter Notebook

  1. Start the NotebookApp from the project directory by executing jupyter notebook. Navigate to the Chapter-3 directory and open up the chapter-3-workbook.ipynb file. Find the cell near the top where the packages are loaded and run it.

We are going to request a web page and then examine the response object. There are many different libraries for making requests and many choices for exactly how to do so with each. We'll only use the Requests library, as it provides excellent documentation, advanced features, and a simple API.

  1. Scroll down to Subtopic Introduction to HTTP requests and run the first cell in that section to import the Requests library. Then, prepare a request by running the ...

Get Applied Deep Learning with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.