本文介绍了导入错误:没有模块名为BeautifulSoup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在使用BeautifulSoup的easy_install并试图下面的脚本运行安装
I have installed BeautifulSoup using easy_install and trying to run following script
from BeautifulSoup import BeautifulSoup
import re
doc = ['<html><head><title>Page title</title></head>',
'<body><p id="firstpara" align="center">This is paragraph <b>one</b>.',
'<p id="secondpara" align="blah">This is paragraph <b>two</b>.',
'</html>']
soup = BeautifulSoup(''.join(doc))
print soup.prettify()
但不知道为什么会这样。
But not sure why this is happening
Traceback (most recent call last):
File "C:\Python27\reading and writing xml file from web1.py", line 49, in <module>
from BeautifulSoup import BeautifulSoup
ImportError: No module named BeautifulSoup
你能帮。
谢谢
Could you please help.Thanks
推荐答案
试试这个从BS4进口BeautifulSoup
此可能与美丽的汤,第4版,以及测试天的问题。我刚刚从网页阅读。
This might be a problem with Beautiful Soup, version 4, and the beta days. I just read this from the homepage.
这篇关于导入错误:没有模块名为BeautifulSoup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!