Changed selenium.webdriver.find_element_by_id(...) to selenium.webdriver.find_element(By.ID, ...) to fix an error when running the Firefox web driver.

This commit is contained in:
Charlie Shafer 2022-09-07 23:33:53 -04:00
parent 79e2cea3ca
commit 17acb91413

View File

@ -10,6 +10,7 @@ import binascii
import requests import requests
from getpass import getpass from getpass import getpass
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.by import By
from optparse import OptionParser from optparse import OptionParser
PY3 = sys.version_info[0] == 3 PY3 = sys.version_info[0] == 3
@ -99,9 +100,9 @@ def fetch_activation_bytes(username, password, options):
print("[!] Running in DEBUG mode. You will need to login in a semi-automatic way, wait for the login screen to show up ;)") print("[!] Running in DEBUG mode. You will need to login in a semi-automatic way, wait for the login screen to show up ;)")
time.sleep(32) time.sleep(32)
else: else:
search_box = driver.find_element_by_id('ap_email') search_box = driver.find_element(By.ID, 'ap_email')
search_box.send_keys(username) search_box.send_keys(username)
search_box = driver.find_element_by_id('ap_password') search_box = driver.find_element(By.ID, 'ap_password')
search_box.send_keys(password) search_box.send_keys(password)
search_box.submit() search_box.submit()
time.sleep(2) # give the page some time to load time.sleep(2) # give the page some time to load