Browse Source

Match anything with "Unlike" for pages because FB keeps changing the

elements
pull/51/head
Wesley Kerfoot 5 years ago
parent
commit
bf6ce1d615
  1. 5
      deletefb/tools/likes.py

5
deletefb/tools/likes.py

@ -59,6 +59,7 @@ def unlike_page(driver, url):
"""
driver.get(url)
print(url)
wait = WebDriverWait(driver, 30)
actions = ActionChains(driver)
@ -73,11 +74,11 @@ def unlike_page(driver, url):
click_button(driver, button)
wait.until(
EC.presence_of_element_located((By.XPATH, "//a/span[text()='Unlike']"))
EC.presence_of_element_located((By.XPATH, "//*[text()='Unlike']"))
)
# There should be an "Unlike" button now, click it
unlike_button = driver.find_element_by_xpath("//a/span[text()='Unlike']/..")
unlike_button = driver.find_element_by_xpath("//*[text()='Unlike']/..")
click_button(driver, unlike_button)

Loading…
Cancel
Save