Python - Install BeautifulSoup
Python - Install BeautifulSoup
To install BeautifulSoup in your system, you can use pip command.
Open a terminal or command prompt based on your operating system, and run the following pip command.
pip install beautifulsoup4
If you are running Python3 with pip3, run the following command instead.
pip3 install beautifulsoup4
Terminal Output
sh-3.2# pip3 install beautifulsoup4
Collecting beautifulsoup4
Downloading beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.0/143.0 kB 1.3 MB/s eta 0:00:00
Requirement already satisfied: soupsieve>1.2 in /opt/homebrew/lib/python3.11/site-packages (from beautifulsoup4) (2.5)
Installing collected packages: beautifulsoup4
Successfully installed beautifulsoup4-4.12.2
Once the installation is done, you can verify it by importing BeautifulSoup from bs4 package in a Python program, as shown in the following.
Run the following program, and if it runs without any errors, then BeautifulSoup is available to use in your program, and you are good to go with the next tutorials of BeautifulSoup.