【问题标题】:How to install and use beautifulsoup4如何安装和使用beautifulsoup4
【发布时间】:2015-03-14 08:23:28
【问题描述】:

我想在 python3.4.3 (windows 7) 上使用 BeautifulSoup。我用 cmd.exe 安装了它。但是当我尝试导入它时,我收到一条错误消息,提示没有名为 BeautifulSoupBeautifulSoup4 的模块。

你能帮帮我吗?这就是我安装beautifulsoup4的方式:

C:\Python34\Scripts\pip.exe install beautifulsoup4

【问题讨论】:

  • 您是否通读了您将要使用的模块的docs 中的第一个示例?考虑在未来这样做。

标签: python python-3.x beautifulsoup


【解决方案1】:

模块名为bs4:

from bs4 import BeautifulSoup

确保将 correct documentation 用于 BeautifulSoup 版本 4,它列出了这些详细信息。

是的,项目名称 (beautifulsoup4) 与您导入的模块不同!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-16
    • 2020-03-01
    • 2012-12-18
    • 2016-06-26
    • 2020-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多