小编Muh*_*ran的帖子

ImportError:没有名为BeautifulSoup的模块

我已经使用easy_install安装了BeautifulSoup并尝试运行以下脚本

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()
Run Code Online (Sandbox Code Playgroud)

但不确定为什么会这样

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
Run Code Online (Sandbox Code Playgroud)

能否请你帮忙.谢谢

python beautifulsoup

77
推荐指数
4
解决办法
9万
查看次数

在rdflib中从rdf Triples编写RDF/XML文件

我有rdf三元组,现在我有兴趣在Python中使用rdflib生成RDF/XML文件.你能不能给我一些示例代码来开始.

谢谢

python rdflib triples

6
推荐指数
1
解决办法
3009
查看次数

标签 统计

python ×2

beautifulsoup ×1

rdflib ×1

triples ×1