Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BeautifulSoup's Python 3 compatibility

Tags:

Does BeautifulSoup work with Python 3?

If not, how soon will there be a port? Will there be a port at all?

Google doesn't turn up anything to me (Maybe it's 'coz I'm looking for the wrong thing?)

like image 386
Yuvi Avatar asked Sep 29 '08 16:09

Yuvi


People also ask

How do I use BeautifulSoup in Python 3?

First, we need to import all the libraries that we are going to use. Next, declare a variable for the url of the page. Then, make use of the Python urllib2 to get the HTML page of the url declared. Finally, parse the page into BeautifulSoup format so we can use BeautifulSoup to work on it.

Is bs4 same as BeautifulSoup?

As BeautifulSoup is not a standard python library, we need to install it first. We are going to install the BeautifulSoup 4 library (also known as BS4), which is the latest one.

What is the latest version of BeautifulSoup?

The latest Version of Beautifulsoup is v4. 9.3 as of now.

What is bs4 in BeautifulSoup?

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. BeautifulSoup 4 Guide.


2 Answers

About two months after I asked this question, a port has been released:

http://groups.google.com/group/beautifulsoup/browse_thread/thread/f24882cc17a0625e

It'll bet BS working, but that's about it. Not yet tried it though.

like image 31
Yuvi Avatar answered Sep 22 '22 15:09

Yuvi


Beautiful Soup 4.x officially supports Python 3.

pip install beautifulsoup4
like image 155
badp Avatar answered Sep 22 '22 15:09

badp