I tried to use Selenium with Chrome, but I was unable to find elements on the page. I tried it with link text, XPath, and full XPath, but there was just one error and it wasn't clicking on the element.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver= webdriver.Chrome()
driver.get("https://www.youtube.com/")
print(driver.title)
driver.find_element_by_xpath("//*[@id='search']").click()
Output:
UserWarning: find_element_by_* commands are deprecated. Please use find_element() instead
warnings.warn("find_element_by_* commands are deprecated. Please use find_element() instead")
I'm using ChromeDriver 81.0.4044.69 and version 81.0.4044.113 of the browser.