BeautifulSoup的Python 3兼容性
时间:2020-03-06 14:53:04 来源:igfitidea点击:
BeautifulSoup是否可以与Python 3一起使用?
如果没有,那么多久以后会有一个港口?会不会有港口?
Google并没有向我提出任何要求(也许是因为我在找错东西吗?)
解决方案
我猜答案是"否"。根据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.
这个特定问题的一个更好的地方可能是BeautifulSoup论坛。
有适用于Python 3.0的候选版本,因此我们始终可以自己测试BeautifulSoup的兼容性:)
在我问了这个问题大约两个月后,一个端口被释放了:
http://groups.google.com/group/beautifulsoup/browse_thread/thread/f24882cc17a0625e
它将打赌BS可以正常工作,仅此而已。尚未尝试过。
http://www.crummy.com/software/BeautifulSoup/说:
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.