BeautifulSoup difference between findAll and findChildren

随声附和 提交于 2020-01-24 09:40:08

问题


What is the difference? Don't they do the same thing - find the inside tags with given properties?


回答1:


findChildren returns a resultSet just as find_all does, there is no difference in using either method as findChildren is actually find_all, if you look at the link to the source you can see:

 findChildren = find_all  # BS2

It's there for backwards compatibility as is findAll = find_all # BS3



来源:https://stackoverflow.com/questions/38838460/beautifulsoup-difference-between-findall-and-findchildren

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!