How did it work?
First, we setup the
url to our webpage.
url = "https://scientificprogramming.io"
Next, we scrap the whole page using the Python
req = requests.get(url)
Now, the functionality of the Bs4 begins. The BeautifulSoup constructor function takes in two string arguments:
- The HTML string to be parsed (
- Optionally, the name of a parser (
soup object after parsing:
soup = BeautifulSoup(req.text, "html.parser")
We can do the following with this
Great! you have learned your first BS4 scraping!