What is the difference beautifulsoup and bs4
Solution 1
When I go to the beautifulsoup 4.0 documentation, the first page has this information:
(The BeautifulSoup package is probably not what you want. That’s the previous major release, Beautiful Soup 3. Lots of software uses BS3, so it’s still available, but if you’re writing new code you should install beautifulsoup4.)
Solution 2
For those, like me, reading this years later, please note. The above is referring to installing with a system package manager, like apt-get, from which you can install python-bs4 or python3-bs4.
If installing with pip, use pip install beautifulsoup4
, currently at V4.7.1.
Solution 3
Since March 2016 there is bs4
package on PyPI
The description is
This is a dummy package managed by the developer of Beautiful Soup to prevent name squatting. The official name of PyPI’s Beautiful Soup Python package is
beautifulsoup4
. This package ensures that if you typepip install bs4
by mistake you will end up withBeautiful Soup
.
Related videos on Youtube
The Bndr
Updated on September 19, 2021Comments
-
The Bndr over 2 years
I'm new to python and I tried to parse some XML files in order to add some new tags and store that new XML file.
python-beautifulsoup
seams to be the right package for that. Searching around the web for tutorials, how to add an new tag to XML parsed by BeautifulSoup, i found out, that the packagepython-bs4
is used.Looking at the package description, both packages have the same title:
python-bs4 - error-tolerant HTML parser for Python python-beautifulsoup - error-tolerant HTML parser for Python
So my question: what is the difference?
-
GoBusto about 9 yearsGiven that is literally the only question for the bs4 tag, I'd assume that BS4 is simply version 4 of Beautiful Soup.
-
Russell Smith about 9 yearsGiven the fact that the answer is in the documentation for the bs4 package, the down-vote could be because the questions showed no signs of research.
-
-
The Bndr about 9 yearsOkay, thank you. That was helpful. This information is part of the "installation" section, which I did not read, because installing the package was not a problem! ;-)
-
Michael Harley over 3 yearsUpdating the current version. 23 Oct 2020 is v4.9.3.