Selenium: print all span text

A short code to get all span text in your web page:

 span_list= await driver.findElements(By.xpath("//span"));
 for(i=0;i<span_list.length;i++)
       console.log(await span_list[i].getText())

Leave a Reply

Your email address will not be published. Required fields are marked *