BS4---from bs4 import beautifulsoup 导入报错总结

一、BeautifulSoup4的安装
方法一:cmd->easy_install BeautifulSoup
方法二:从http://www.crummy.com/software/BeautifulSoup/bs4/download/
下载->cmd->进入下载的文件目录->python setuyp.py install
二、 BeautifulSoup4的使用
1、导入
from bs4 import BeautifulSoup
注意:要是BeautifulSoup的版本为3.x,则导入方式为:from BeautifulSoup import BeautifulSoup
三、错误:
Python 底层存在bs4文件,所以做测试文件的时候不能将名字写成 bs4.py

猜你喜欢

转载自blog.csdn.net/qq_42817166/article/details/83105845