BeautifulSoup's Python 3 compatibility
-
02-07-2019 - |
Question
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?)
Solution 2
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.
OTHER TIPS
Beautiful Soup 4.x officially supports Python 3.
pip install beautifulsoup4
http://www.crummy.com/software/BeautifulSoup/ says:
Download Beautiful Soup
If you're using Python 2.3 through 2.6, the 3.0 series is the best choice. The most recent release in the 3.0 series is 3.0.8, released November 30, 2009.
If you're using Python 3.0, you must use the 3.1 series. Beautiful Soup version 3.1.0.1 was released January 6, 2009. You can use the 3.1 series with earlier versions of Python, but you might run into the problems described here.
There's a release candidate for Python 3.0 available, so you can always test BeautifulSoup's compatibility yourself :)
I'm guessing the answer is "No". According to Python.org:
Python 3000 (a.k.a. "Py3k", and released as Python 3.0) is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard library has been reorganized in a few prominent places.
A better place for this particular question might be the BeautifulSoup forum.
yes,beautiful soup work in python 3,
Linux
apt-get install python3-bs4
Windows
pip install beautifulsoup4
For more information see https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-beautiful-soup