Browse Source

More cleanup

pull/23/head
wes 6 years ago
parent
commit
1502feef4b
  1. 3
      deletefb/tools/common.py
  2. 8
      deletefb/tools/likes.py
  3. 12
      deletefb/tools/login.py
  4. 3
      deletefb/tools/wall.py

3
deletefb/tools/common.py

@ -0,0 +1,3 @@
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException
SELENIUM_EXCEPTIONS = (NoSuchElementException, StaleElementReferenceException)

8
deletefb/tools/likes.py

@ -0,0 +1,8 @@
from selenium.webdriver.common.action_chains import ActionChains
from .common import SELENIUM_EXCEPTIONS
def unlike_pages(driver):
"""
Unlike all pages
"""
return

12
deletefb/tools/login.py

@ -36,14 +36,14 @@ def login(user_email_address,
password = "pass" password = "pass"
login = "loginbutton" login = "loginbutton"
emailelement = driver.find_element_by_name(email) email_element = driver.find_element_by_name(email)
passwordelement = driver.find_element_by_name(password) password_element = driver.find_element_by_name(password)
emailelement.send_keys(user_email_address) email_element.send_keys(user_email_address)
passwordelement.send_keys(user_password) password_element.send_keys(user_password)
loginelement = driver.find_element_by_id(login) login_element = driver.find_element_by_id(login)
loginelement.click() login_element.click()
if "Two-factor authentication" in driver.page_source: if "Two-factor authentication" in driver.page_source:
# Allow time to enter 2FA code # Allow time to enter 2FA code

3
deletefb/tools/wall.py

@ -1,10 +1,9 @@
import time import time
from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException from .common import SELENIUM_EXCEPTIONS
MAX_POSTS = 5000 MAX_POSTS = 5000
SELENIUM_EXCEPTIONS = (NoSuchElementException, StaleElementReferenceException)
def delete_posts(driver): def delete_posts(driver):
""" """

Loading…
Cancel
Save