Warning while using selenium with python

Viewed 283

While finding tag or class in a html using selenium, I am getting the following warning:

<ipython-input-6-f7f8e8a9bbfc>:32: DeprecationWarning: find_elements_by_* commands are deprecated. Please use find_elements() instead
  divTag = driver.find_elements_by_class_name('quote')

But find_elements() is also not working:

InvalidArgumentException: Message: invalid argument: invalid locator
  (Session info: chrome=95.0.4638.69)
Stacktrace:
Backtrace:

Can someone help me in removing the warning?

1 Answers

Instead of

divTag = driver.find_elements_by_class_name('quote')

Try using

divTag = driver.find_elements(By.CLASS_NAME,'quote')
Related