In this video, Kathryn shows you how to use the urllib module to get content from the internet. She then shows you how to use the JSON module to decode this content and get what you need from it.
- [Instructor] We are going to use the urllib module…to get content from the internet.…To do this, we're going to have to import some things.…So we are going to import the urllib.request,…and this is just a class that we're going to use.…And then we're going to import json…and we're also going to import the textwrap module.…And I'll explain how these fit in in a minute.…But in this video, we are going to use the Google Books API.…And so what's going to happen is we are going to give…Google Books an ISBN number, and then it's going to take…that ISBN number and get some data on that specific book.…
And so this is the URL that we are going to use to do this.…And so in order to make this get request,…we are going to go with urllib.request,…so using this urllib module,…urlopen, which is the function we're using,…and I'm just going to copy and paste this…right inside of here, inside of a string.…To find out more information about the Google Books API…and how this URL works,…go look at the information down below.…
This URL will also be down there, and so you can just…
- Working with logical and comparison operators
- Getting a list of numbers with the range() and list() functions
- Using mathematical functions such as round(), abs(), and pow()
- Calculating a given input's length
- Importing and using the math module
- Reading a user's command-line arguments
- Getting the current time
- Formatting dates and times with datetime
- Creating a timer
- Using urllib to get content from the Internet
- Using the JSON module to decode content
Skill Level Intermediate
Learning the Standard PHP Librarywith David Powers3h 24m Intermediate
Python: Data Analysis (2015)with Michele Vallisneri2h 16m Intermediate
1. Python: What's Built-In?
2. Python: Math
3. Python: Input/Output
4. Python: Date & Time, HTML Parsing, and HTTP
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.