Hi there,
Can you help me to get the element name from the website that I want to log-in to? I tried everything...:( I tried username, email, login-username, mat-input-0
Code for Python is:
Can you help me to get the element name from the website that I want to log-in to? I tried everything...:( I tried username, email, login-username, mat-input-0
Code for Python is:
from selenium import webdriver browser = webdriver.Chrome() browser.get("") username = browser.find_element_by_name("") username.click() username.send_keys("")Code from website element is
<input matinput type="email" formcontrolname="username" test-id="login-username" class="mat-input-element mat-form-field-autofill-control ng-tns-c185-3 cdk-text-field-autofill-monitored ng-pristine ng-invalid ng-touched" id="mat-input-0" placeholder="Username / email" aria-invalid="true" aria-required="false">Im getting the error:
Error:Traceback (most recent call last):
File "login.py", line 32, in <module>
username = browser.find_element_by_name("username")
File "C:\Users\Example\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 496, in find_element_by_name
return self.find_element(by=By.NAME, value=name)
File "C:\Users\Example\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Example\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Example\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[name="username"]"}
(Session info: chrome=84.0.4147.89)