我们查找文档中的href="http://example.com/lacie"的节点元素
from bs4 import BeautifulSoupdoc='''The Dormouse's storyElsieLacieTillie'''def myFilter(tag): print(tag.name) __________________________________________soup=BeautifulSoup(doc,"lxml")tag=soup.find_all(myFilter)print(tag)缺失的语句是:
A.
return (tag.name=="a" and tag["href"]=="http://example.com/lacie")
B.
return (tag.name=="a" and tag.has_attr("href") and tag["href"]=="http://example.com/lacie")
C.
return (tag.name=="a" and tag.has_attr("href") and tag.href=="http://example.com/lacie")
D.
return (tag.name=="a" and tag.href=="http://example.com/lacie")