I tried to use Selenium with Chrome but was unable to find elements on the page, I tried it with link text, XPath, 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")