AviatingFotographer
AviatingFotographer

Reputation: 328

Match multiple class names

Is it possible to get Selenium to match multiple class names?
For example:

driver.find_elements_by_class_name('image' or 'image-large')

Thanks

Upvotes: 0

Views: 102

Answers (1)

Martín De la Fuente
Martín De la Fuente

Reputation: 6736

In CSS you would do .image, .image-large to match elements that have either image class or image-large class.

And Selenium has a CSS selector method:

driver.find_elements_by_css_selector('.image, .image-large')

Upvotes: 3

Related Questions