I have been using selenium for a while with these two methods interchangeably.
elem = driver.find_element_by_xpath("some_xpath") elem = driver.find_element(By.XPATH,"some_xpath") So far both of them work. I wanted to understand what is the difference in both of them.
https://selenium-python.readthedocs.io/locating-elements.html Documentation mentions By.XPATH as private method, but did not understand it clearly.