Chapter 3
Interacting with the Internet
IN THIS CHAPTER
Understanding how the web works
Opening web pages from Python
Using Python to post to the web
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, Google Chrome, Firefox, Opera, Internet Explorer, or Edge. 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.
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 a sense, you make the web your personal database of knowledge from which your apps can pluck information at will. In this chapter, you learn about the two main modules for accessing the web programmatically with Python: urllib and BeautifulSoup.
Seeing How ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access