Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference beautifulsoup and bs4

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 package python-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?

like image 629
The Bndr Avatar asked Mar 26 '15 16:03

The Bndr


People also ask

What is the difference between bs4 and BeautifulSoup?

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 type pip install bs4 by mistake you will end up with Beautiful Soup .

What is BeautifulSoup in bs4?

Beautiful Soup is a Python library for pulling data out of HTML and XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work.

What is BeautifulSoup used for?

Beautiful Soup is a Python library that is used for web scraping purposes to pull the data out of HTML and XML files. It creates a parse tree from page source code that can be used to extract data in a hierarchical and more readable manner.

Is bs4 built in Python?

bs4: Beautiful Soup(bs4) is a Python library for pulling data out of HTML and XML files. This module does not come built-in with Python.


1 Answers

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.)

like image 111
Bryan Oakley Avatar answered Oct 05 '22 22:10

Bryan Oakley