Issue
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?
Solution
Instead of
divTag = driver.find_elements_by_class_name('quote')
Try using
divTag = driver.find_elements(By.CLASS_NAME,'quote')
Answered By - Prophet
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.