Skip to content

Commit

Permalink
facebook: remove xpaths in preference for a more flexible search
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Oct 8, 2024
1 parent 5f64e0f commit 8b94ba2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions automon/integrations/facebook/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def privacy_details(self):

try:
known_privacy_details = [
'Anyone can find this group.'
"Anyone can see who's in the group and what they post.",
]

for privacy_details in known_privacy_details:
Expand Down Expand Up @@ -316,7 +316,21 @@ def url_cleaner(url: str):
def visible(self) -> str:

try:
text = self._browser.wait_for_anything(self._xpath_visible)
known_visible = [
'Anyone can find this group.',
]

for visible in known_visible:
text = self._browser.wait_for_anything(
match=visible,
value='span',
by=self._browser.by.TAG_NAME,
exact_match=True
)
if text:
break

text = text[-1]
text = text.text
logger.debug(text)
return text
Expand Down

0 comments on commit 8b94ba2

Please sign in to comment.