0

I am trying to get all elements with a certain class name:

theButtons = browser.find_elements_by_class_name("Icon Icon--medium Icon--reply");

However I get the error:

Compound class names not permitted

I understand that spaces are not allowed in the class name to get it, but then what should I do?

Thanks

Joe Sgg
  • 71
  • 3
  • 8

1 Answers1

0

Try with xpath:

theButtons = browser.find_elements_by_xpath("//*[contains(@class,'Icon Icon--medium Icon--reply')]");

or

theButtons = browser.find_elements_by_xpath("//*[@class='Icon Icon--medium Icon--reply']");

Replace the quotes if I am wrong as I have less knowledge of Python

iamsankalp89
  • 4,607
  • 2
  • 15
  • 36