Chapter 12

Interacting with the Internet

IN THIS CHAPTER

Bullet Understanding how the web works

Bullet Opening web pages from Python

Bullet Using Python to post to the web

Bullet Web scraping with Python

As you probably know, the internet is home to virtually all the world’s knowledge. Most of us use the web all the time to find information. We do so using a web browser such as Safari or Google Chrome. To visit a website, you type a Uniform Resource Locator (URL) into your browser’s address bar and press Enter, or you click a link that sends you to the page automatically. This is the most complicated chapter in our book, but it is one of the most interesting to play with.

As an alternative to browsing the web with your web browser, you can access its content programmatically. In other words, you can use a programming language such as Python to post information to the web, as well as to access web information. In this chapter, you learn about the two main modules for accessing the web programmatically with Python: urllib and BeautifulSoup.

Seeing How the Web Works

When you open up your web browser and type ...

Get Python Essentials For Dummies 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.