python - BeautifulSoup findAll 和 findChildren 之间的区别

标签 python beautifulsoup

有什么区别?他们不做同样的事情 - 找到具有给定属性的内部标签吗?

最佳答案

findChildren 返回一个 resultSet 就像 find_all 一样,使用任何一种方法都没有区别,如 findChildren实际上是 find_all,如果您查看源代码的链接,您可以看到:

 findChildren = find_all  # BS2

这是为了向后兼容 findAll = find_all # BS3

关于python - BeautifulSoup findAll 和 findChildren 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38838460/

相关文章:

python - 'Manager' 对象在 django 1.7 中没有属性 'create_user'

python - 从指定id的div开始获取嵌套的div内容

python - 使用 `exec` 调用时如何更新局部变量?

python - 从字典中删除重复项

python - 循环中的选项值

Python BeautifulSoup 每页仅获取 1 项

python - beautifulsoup 无法正确解析 xml 标签,但 lxml 是

python - 从多表维基百科中抓取一张表

python - 跨多个用户的 RESTful API

python - 从现有的两列python创建唯一ID