Python > 3.0导入库整理

1、from sgmllib import SGMLParser

2、from bs4 import BeautifulSoup:原始的 from BeautifulSoup import BeautifulSoup不能用了,安装了BeautifulSoup以后,需要以这种方式才能通过。

3、from urllib.request import urlopen:3.0以下版本都是直接使用import urllib2即可使用,但是到3.0以上后需要
from urllib.request import urlopen才能使用,在python帮助文档中也有专门指出。

posted on 2013-02-26 15:42  骑驴走天下  阅读(392)  评论(0编辑  收藏  举报

导航