通过函数查找可以查找到一些复杂的节点元素,查找文本值以 "cie" 结尾所有 节点 from bs4 import BeautifulSoup doc=''' The Dormouse's story Elsie Lacie Tillie Tilcie ''' def endsWith(s,t): if len(s)>=len(t): ___________________________ return False def myFilter(tag): return (tag.name=="a" and _____________________________) soup=BeautifulSoup(doc,"lxml") tags=soup.find_all(myFilter) for tag in tags: print(tag) 缺失的语句是:
A.return s[len(s)-len(t)-1:]==t; endsWith(tag.text,"cie")
B.return s[len(s)-len(t)-1:]==t; endsWith(tag["text"],"cie")
C.return s[len(s)-len(t):]==t; endsWith(tag["text"],"cie")
D.return s[len(s)-len(t):]==t; endsWith(tag.text,"cie")