8

Python爬虫编程思想(96):使用Selenium查找多个节点

 2 years ago
source link: https://blog.csdn.net/nokiaguy/article/details/121895061
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.
neoserver,ios ssh client

Python爬虫编程思想(96):使用Selenium查找多个节点

        Selenium提供的另外一类API可以查找多个节点,这些API都会返回一个列表,包含了所有符合条件的节点,如果没有符合条件的节点,那么就会返回空列表(长度为0的列表)。这些API就是以find_elements开头的方法,如图1所示。

        查找多个节点的方法与查找单个节点的方法在使用方式上完全相同,只是前者返回的是一个列表,后者返回的是单个节点。

        下面的例子使用selenium通过节点名查找所有符合条件的节点,并输入节点本身、符合条件的节点总数以及第1个符合条件的节点的文本。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK