Quantcast
Channel: find_element_by_* commands are deprecated in Selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Lagyu for find_element_by_* commands are deprecated in Selenium

$
0
0

As others mentioned, you should use find_element() or find_elements() instead of find_element_by_*() or find_elements_by_*().

I wrote the regex pattern to replace the deprecated methods to new ones, so try this if you need.

# from - e.g. find_element_by_id("test")find_element(s?)_by_([a-z_]+)\((.*)# to - e.g. find_element(By.ID, "test")find_element$1(By.\U$2\E, $3

Note: you need the import line to use the new methods

from selenium.webdriver.common.by import By

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>