True可以匹配任何值,下面代码查找到所有的tag,但是不会返回字符串节点
True
for tag in soup.find_all(True): print(tag.name) # html # head # title # body # p # b # p # a # a # a # p
Last updated 6 years ago