我写了这段代码:
from urllib.request import *
smhw='https://www.showmyhomework.co.uk/todos/issued'
page = urlopen(smhw)
print(page)
from bs4 import BeautifulSoup
soup = BeautifulSoup(page)
print(soup.prettify())
然而,当我运行它时,我收到此错误消息:
<http.client.HTTPResponse object at 0x000001CACE879438>
Traceback (most recent call last):
File "E:\Bill's stuff\ws.py", line 5, in <module>
from bs4 import BeautifulSoup
ImportError: No module named 'bs4'
有一个名为bs4的模块,所以我不知道该怎么做。谢谢你的回答。
答案 0 :(得分:0)
对于Python 3
按照以下步骤操作:
现在下载此文件
https://drive.google.com/open?id=0B9JWvFYLLVfpZW1BZ2lncm91aWc