为了账号安全,请及时绑定邮箱和手机立即绑定

错误求解决

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from urllib import request
from bs4 import BeautifulSoup as bs
req=request.Request("http://www.baidu.com")
req.add_header("User-Agent","Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36")
resp=request.urlopen(req)
soup=bs(resp,"html_parser")
print(soup.img)


Traceback (most recent call last):
  File "C:/Users/Administrator.WIN7-20160710FD/PycharmProjects/untitled1/pc1.py", line 4, in <module>
    from bs4 import BeautifulSoup as bs
ImportError: No module named 'bs4'

Process finished with exit code 1



正在回答

1 回答

这应该是你没有安装 BeautifulSoup4的缘故

0 回复 有任何疑惑可以回复我~
#1

慕婉清6220742

安装成功了,还是这样报错 ModuleNotFoundError: No module named 'bs4
2017-12-14 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

错误求解决

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信