0

Python爬虫编程思想(55):Beautiful Soup方法选择器之find_all方法

 2 years ago
source link: https://blog.csdn.net/nokiaguy/article/details/120796983
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Python爬虫编程思想(55):Beautiful Soup方法选择器之find_all方法

目录

1. name参数

2. attrs参数

3. text参数

       前面讲的选择方法都是通过属性来选择节点的,对于比较简单的选择,这种方法使用起来非常方便快捷,但对于比较复杂的选择,这种方法就显得比较笨拙,不够灵活。幸好,Beautiful Soup还为我们提供了一些查询方法,如find_all、find等。调用这些方法,然后传入相应的参数,就可以灵活选择节点了。

        find_all方法用于根据节点名、属性、文本内容等选择所有符合要求的节点。find_all方法的原型如


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK