+ 1

Python - Auto Login

import selenium from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC EmailStr = 'EmailHere' passwordStr = 'PasswordHere' browser = webdriver.Chrome() browser.get('https://discordapp.com/login?redirect_to=%2Factivity') Email = find_element_by_class_name("inputDefault-_djjkz input-cIJ7To size16-14cGz5") Email.send_keys(EmailStr) Password = browser.find_elements_by_class_name("inputDefault-_djjkz input-cIJ7To size16-14cGz5") Password.send_keys(passwordStr) nextButton = browser.find_elements_by_class_name('contents-18-Yxp') nextButton.click() ERROR -> Traceback (most recent call last): File "C:/Users/925ra/Desktop/WebControl.py", line 14, in <module> Email = find_element_by_class_name("inputDefault-_djjkz input-cIJ7To size16-14cGz5") NameError: name 'find_element_by_class_name' is not defined (I'm trying to make an automatic Login script for discord, I think the problem is trying to locate the text field for the Email, there's no Name or ID so I have to locate it by its class, its confusing)

12th Dec 2018, 1:26 AM
MyMomAteMyCat123
MyMomAteMyCat123 - avatar
2 odpowiedzi
+ 1
HERE IS THE LOGIN CODE FOR THE EMAIL PART <div class="inputWrapper-31_8H8 vertical-V37hAW flex-1O1GKY directionColumn-35P_nr"><input class="inputDefault-_djjkz input-cIJ7To size16-14cGz5" type="email" autocomplete="off" spellcheck="false" placeholder="" name="" maxlength="999" value=""></div>
12th Dec 2018, 1:31 AM
MyMomAteMyCat123
MyMomAteMyCat123 - avatar
+ 1
HERE IS THE LOGIN CODE FOR THE PASSWORD PART <div class="inputWrapper-31_8H8 vertical-V37hAW flex-1O1GKY directionColumn-35P_nr"><input class="inputDefault-_djjkz input-cIJ7To size16-14cGz5" type="password" autocomplete="off" spellcheck="false" placeholder="" name="" maxlength="999" value=""></div>
12th Dec 2018, 1:32 AM
MyMomAteMyCat123
MyMomAteMyCat123 - avatar