当我尝试运行代码时,Beautiful Soup导致错误

时间:2019-07-19 02:16:40

标签: python beautifulsoup

我正在使用python启动一个webscraping项目。我已按照说明进行操作,并将bs4安装到我的site-packages目录中。

  • 我在Windows 10上
  • 我正在使用Atom作为文本编辑器
  • 我使用的命令 是网站包目录中的“ pip install bs4”

从urllib.request导入urlopen作为uReq 从bs4导入BeautifulSoup

Traceback (most recent call last):
  File "C:\Users\Mir Cool\Desktop\AutomateBoring\webScraper.py", line 4, in <module>
    from bs4 import BeautifulSoup
  File "C:\Users\Mir Cool\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bs4\__init__.py", line 34, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "C:\Users\Mir Cool\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bs4\builder\__init__.py", line 7, in <module>
    from bs4.element import (
  File "C:\Users\Mir Cool\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bs4\element.py", line 19, in <module>
    from bs4.dammit import EntitySubstitution
  File "C:\Users\Mir Cool\AppData\Local\Programs\Python\Python37-32\lib\site-packages\bs4\dammit.py", line 15, in <module>
    import logging
  File "C:\Users\Mir Cool\Desktop\AutomateBoring\logging.py", line 3, in <module>
    logging.basicConfig(level = logging.DEBUG, format = '%(asctime)s - %(levelname)s - %(message)s')
AttributeError: module 'logging' has no attribute 'basicConfig'

0 个答案:

没有答案