Fetching Text from a Website
Develop the web scraping and data saving program.
We'll cover the following
These are the libraries that we will be using.
import requests
from bs4 import BeautifulSoup
import openpyxl
Getting text
The first function you want to create will accept a website address (URL) as an argument and return the text (the code as str
) of the website. This is a good, neutral function that can be included in any other program you write because it is agnostic to the URL.
Get hands-on with 1400+ tech skills courses.