'WebDriver' object has no attribute 'find'

Issue

im trying to make a program that will automatically log me into xbox live but when I try to find password box it gives me an error(I am new to selenium)

here is my code

import selenium
from selenium.webdriver.common.by import By
from selenium import webdriver

driver = webdriver.Chrome('C:/Users/Ziad/Downloads/chromedriver.exe') 

# Open the website
driver.get('https://login.live.com/login.srf? 
wa=wsignin1.0&rpsnv=13&rver=7.3.6963.0&wp=MBI_SSL&wreply=https:%2f%2faccount.xbox.com%2fen- 
ca%2faccountcreation%3freturnUrl%3dhttps%253a%252f%252fwww.xbox.com%252fen- 
US%252f%26ru%3dhttps%253a%252f%252fwww.xbox.com%252fen- 
US%252f%26rtc%3d1%26csrf%3dBX6_qLmRUdfyOHoeO0IvLFDfk0SGCHKC_sUHYJgFzkwdHQ_iXN1RVGdTHg2s6i- 
0EDtcSq07ELE4p1pROciMvV0pj0o1&lc=4105&id=292543&aadredir=1')

#enter email
sign_in = driver.find_element_by_name('loginfmt')
sign_in.send_keys('email')

#click next
next_button = driver.find_element(By.ID,"idSIButton9")
next_button.click()

#password
pass_box = driver.find.element_by_name("passwd")
pass_box.send_keys('password')

here is the error I get

line 19, in 
<module>
pass_box = driver.find.element_by_name("passwd")
AttributeError: 'WebDriver' object has no attribute 'find'

Solution

There is a typo as find as in driver.find appears to be an attribute.

You need to replace:

driver.find.element_by_name("passwd")

with

driver.find_element_by_name("passwd")

Answered By – undetected Selenium

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published