close

[Solved] DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead

Hello Guys, How are you all? Hope You all Are Fine. Today I am using selenium webdriver in my python project whenever I am using find_element_by_class_name I am facing following error DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead Error Occurs ?

I am using selenium webdriver in my python project whenever I am using find_element_by_class_name I am facing following error.

DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead

How To Solve DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead Error ?

  1. How To Solve DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead Error ?

    To Solve DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead Error Actually the find_element_by_* commands are deprecated in the latest Selenium Python libraries. So that you have to use find_element() just like this: from selenium.webdriver.common.by import By fnd_btn = driver.find_element(By.CLASS_NAME, “your_class_name”) Now, Your error must be solved.

  2. DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead

    To Solve DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead Error Actually the find_element_by_* commands are deprecated in the latest Selenium Python libraries. So that you have to use find_element() just like this: from selenium.webdriver.common.by import By fnd_btn = driver.find_element(By.CLASS_NAME, “your_class_name”) Now, Your error must be solved.

Solution 1: use find_element() in this way

Actually the find_element_by_* commands are deprecated in the latest Selenium Python libraries. So that you have to use find_element() just like this.

from selenium.webdriver.common.by import By

fnd_btn = driver.find_element(By.CLASS_NAME, "your_class_name")

Now, Your error must be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment