© Irv Kalb 2016

Irv Kalb, Learn to Program with Python, 10.1007/978-1-4842-2172-3_10

10. Internet Data

Irv Kalb

(1)Mountain View, California, USA

In the previous two chapters, we discussed different ways to get and manipulate strings. This is our third chapter on strings. Earlier, I talked about how a program can get text input from the user by using a call to raw_input. In the previous chapter, I showed how a program could get data from and save data to a file. But there is another place where programs can get text data from: the Internet!

This chapter discusses the following topics:

  • Request/response model

  • Requests with values

  • Example URL: getting a stock price

  • Pretending to be a browser

  • API

  • Example program to get stock price information using an API ...

Get Learn to Program 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.