【发布时间】:2012-03-30 17:47:30
【问题描述】:
我在这里的第一篇文章,我试图在这个特定的 html 中找到所有标签,但我无法将它们取出,这是代码:
from bs4 import BeautifulSoup
from urllib import urlopen
url = "http://www.jutarnji.hr"
html_doc = urlopen(url).read()
soup = BeautifulSoup(html_doc)
soup.prettify()
soup.find_all("a", {"class":"black"})
find 函数返回 [],但我看到 html 中有带有 class:"black" 的标签,是不是漏掉了什么?
谢谢, 韦德兰
【问题讨论】:
-
你用的是什么python版本/库版本/操作系统?
标签: python beautifulsoup