Open In App

Installing BeautifulSoup: A Beginner’s Guide

Last Updated : 28 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

BeautifulSoup is a Python library that makes it easy to extract data from HTML and XML files. It helps you find, navigate, and change the information in these files quickly and simply. It’s a great tool that can save you a lot of time when working with web data. The latest version of BeautifulSoup is v4.13.2.

Prerequisites to Install BeautifulSoup:

How to install BeautifulSoup?

Install BeautifulSoup4 using pip

You can install the Beautiful Soup library on your operating system using the following command:

pip install beautifulsoup4

Once you enter that command, the beautiful soup library should start installing. Here’s an example of what the output should look like:

installing-bs4

Installing beautifulsoup4

Install Beautifulsoup4 using the Source code

You can install BeautifulSoup by directly using the source code. To do this, download the BeautifulSoup 4 source tarball from the official website. After downloading the tarball, navigate to the directory where it was saved and run the appropriate installation commands.

python setup.py install

Verifying Installation

You can check whether the installation of the library was successful or not by trying to import the beautiful soup library in python.

bs4_verification

Importing beautifulsoup4

Now that you’ve installed BeautifulSoup, you’re ready to start using it to pull data from HTML and XML files. Whether you installed it using pip or from the source code, BeautifulSoup makes it easier to work with web data. If you run into any problems during installation or while using the library, you can always check the official BeautifulSoup documentation for help. Enjoy using BeautifulSoup in your projects!


Next Article
Practice Tags :

Similar Reads