Browse Source

(almost) working list of convo URLs

pull/72/head
Wesley Kerfoot 5 years ago
parent
commit
3939c8642d
  1. 2
      deletefb/tools/comments.py
  2. 19
      deletefb/tools/conversations.py
  3. 1
      deletefb/tools/wall.py

2
deletefb/tools/comments.py

@ -13,3 +13,5 @@ def delete_comments(driver, profile_url):
"""
driver.get("{0}/allactivity?privacy_source=activity_log&category_key=commentscluster".format(profile_url))
wait = WebDriverWait(driver, 20)

19
deletefb/tools/conversations.py

@ -4,12 +4,31 @@ from .common import SELENIUM_EXCEPTIONS, logger, click_button
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
LOG = logger(__name__)
def get_conversation_list(driver):
"""
Get a list of conversations
"""
actions = ActionChains(driver)
convos = driver.find_elements_by_xpath("//ul[@aria-label=\"Conversation list\"]/li")
for convo in convos:
actions.move_to_element(convo).perform()
yield convo.find_element_by_xpath("//a")
def delete_conversations(driver):
"""
Remove all conversations within a specified range
"""
driver.get("https://www.facebook.com/messages/t/")
wait = WebDriverWait(driver, 20)
for convo_url in get_conversation_list(driver):
print(convo_url.get_property("data-href"))

1
deletefb/tools/wall.py

@ -42,7 +42,6 @@ def delete_posts(driver,
post_content_element = driver.find_element_by_class_name(post_content_sel)
post_content_ts = driver.find_element_by_class_name(post_timestamp_sel)
# Archive the post
archive_wall_post.archive(
Post(

Loading…
Cancel
Save