如何解决NameError:未定义名称“ _htmlparser”:尝试使用BeautifulSoup时
我正在尝试在我的程序中使用BeautifulSoup,但遇到重大问题。我花了5个小时以上的时间进行故障排除,但无法继续传递此错误消息。
我正在使用Python3 v3.8.3,并已安装pip bs4和BeautifulSoup4
bs4文件夹与我的程序位于同一文件夹中,并使用了import语句
from bs4 import BeautifulSoup
完整的追溯错误消息是:
Traceback (most recent call last):
File "FIBA.py",line 2,in <module>
from bs4 import beautifulsoup
File "/Users/adamsewell/Desktop/Python/Programmes/bs4/__init__.py",line 29,in <module>
from .builder import builder_registry
File "/Users/adamsewell/Desktop/Python/Programmes/bs4/builder/__init__.py",line 303,in <module>
from . import _htmlparser
File "/Users/adamsewell/Desktop/Python/Programmes/bs4/builder/_htmlparser.py",line 41,in <module>
class BeautifulSoupHTMLParser(_htmlparser):
NameError: name '_htmlparser' is not defined
我真的是编程新手,所以只要碰壁,任何帮助都会很棒,谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。