import urllib2
from bs4 import BeautifulSoup #这里需要导入BeautifulSoup
url="http://www.baidu.com"
content=urllib2.urlopen(url)
soup=BeautifulSoup(content) #将网页内容转化为BeautifulSoup 格式的数据
print soup
import urllib2
from bs4 import BeautifulSoup #这里需要导入BeautifulSoup
url="http://www.baidu.com"
content=urllib2.urlopen(url)
soup=BeautifulSoup(content) #将网页内容转化为BeautifulSoup 格式的数据
print soup
本文标题:python 解析html
本文链接:https://www.haomeiwen.com/subject/ljrfqhtx.html
网友评论