Traceback (most recent call last):
File "C:\Users\daoud\Downloads\zyBooks-Activity-Completer\complete.py", line 416, in
login(driver)
File "C:\Users\daoud\Downloads\zyBooks-Activity-Completer\complete.py", line 59, in login
if not email:
UnboundLocalError: local variable 'email' referenced before assignment
Even after defining the email and password variables in the global variables and in a local scope to the function Simillar errors are produced.
Enter your zybooks login below with the course code
email = "" # "ExampleEmail@gmail.com"
course = "" # "ExampleCourseCode"
if not email:
email = input("Please enter your zyBooks email: ")
email_input.send_keys(myEmail)
if (email == "quit"):
print("--Exiting--")
driver.quit()
os._exit(0)
password = getpass.getpass("Enter your zyBooks password: ")
if (password == "quit"):
print("--Exiting--")
driver.quit()
os._exit(0)
Error produced from the log reads:
Traceback (most recent call last): File "C:\Users\daoud\Downloads\zyBooks-Activity-Completer\complete.py", line 416, in
login(driver)
File "C:\Users\daoud\Downloads\zyBooks-Activity-Completer\complete.py", line 59, in login
if not email:
UnboundLocalError: local variable 'email' referenced before assignment
Even after defining the email and password variables in the global variables and in a local scope to the function Simillar errors are produced.
Enter your zybooks login below with the course code email = "" # "ExampleEmail@gmail.com" course = "" # "ExampleCourseCode"
def login(driver): driver.get("https://learn.zybooks.com/signin") while (True): email_input = driver.find_element_by_xpath("//input[@type='email']") password_input = driver.find_element_by_xpath("//input[@type='password']") signin_button = driver.find_element_by_class_name("signin-button")
exception.log geckodriver.log