I am creating a short program in Python - Selenium to login to my Linkedin Profile, it opens the new windows but I get an error on line 13 during the debug:
Exception has occurred: AttributeError
'WebDriver' object has no attribute 'find_element_by_xpath'
File "C:\Users\viale\Desktop\Automation\linkedin_selenium_auto.py", line 13, in <module>
username = driver.find_element_by_xpath("//input[@name='session_key']")
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
import time
driver = webdriver.Chrome("C:/Users/viale/Desktop/Automation/chromedriver.exe")
driver.get("https://linkedin.com")
time.sleep(4)
username = driver.find_element_by_xpath("//input[@name='session_key']")
password = driver.find_element_by_xpath("//input[@name='session_password']")
username.send_keys("username@gmail.com")
password.send_keys("******")
time.sleep(4)
submit = driver.find_element_by_xpath("//button[@type='submit']").click()
time.sleep(4)