Skip to content

Commit

Permalink
[facebook] fix posts_today
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Jan 11, 2025
1 parent a310430 commit 519b7a7
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions automon/integrations/facebook/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def browser_not_supported(self):
self._browser_not_supported = element
return element


def close_login_popup(self):
if self.USE_XPATH:
element = self._browser.wait_for_xpath(value=self._xpath_close_login_popup, timeout=3)
Expand Down Expand Up @@ -346,12 +345,22 @@ def posts_today(self):
element = self._browser.wait_for_xpath(value=self._xpath_posts_today, timeout=3)

else:
element = self._browser.wait_for_anything(
match='new posts today',
value='span',
by=self._browser.by.TAG_NAME
)
element = element[-1]
known_posts_today = [
'new post today'
'new posts today',
]

for posts in known_posts_today:

element = self._browser.wait_for_anything(
match=posts,
value='span',
by=self._browser.by.TAG_NAME
)

if element:
element = element[0]
break

if element:
element = element.text
Expand Down

0 comments on commit 519b7a7

Please sign in to comment.