Skip to content

Commit

Permalink
facebook: search faster
Browse files Browse the repository at this point in the history
specify element attribute to decrease the search range
  • Loading branch information
naisanzaa committed Nov 6, 2024
1 parent fcad320 commit bba9a94
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions automon/integrations/facebook/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def blocked_by_login(self):
self._blocked_by_login = self._browser.wait_for_anything(
match='You must log in to continue.',
value='div',
value_attr='text',
by=self._browser.by.TAG_NAME,
exact_match=True
)
Expand All @@ -74,6 +75,7 @@ def browser_not_supported(self):
self._browser_not_supported = self._browser.wait_for_anything(
match='This browser is not supported',
value='div',
value_attr='text',
by=self._browser.by.TAG_NAME,
exact_match=True
)
Expand Down Expand Up @@ -208,10 +210,12 @@ def members(self):
self._members = self._browser.wait_for_anything(
match='total members',
value='span',
by=self._browser.by.TAG_NAME
value_attr='text',
by=self._browser.by.TAG_NAME,
return_first=True
)
if self._members:
self._members = self._members[-1]
self._members = self._members[0]
self._members = self._members.text
logger.debug(self._members)
return self._members
Expand Down Expand Up @@ -265,10 +269,12 @@ def posts_monthly(self):
self._posts_monthly = self._browser.wait_for_anything(
match='in the last month',
value='span',
by=self._browser.by.TAG_NAME
value_attr='text',
by=self._browser.by.TAG_NAME,
return_first=True
)
if self._posts_monthly:
self._posts_monthly = self._posts_monthly[-1]
self._posts_monthly = self._posts_monthly[0]
self._posts_monthly = self._posts_monthly.text
logger.debug(self._posts_monthly)
return self._posts_monthly
Expand Down

0 comments on commit bba9a94

Please sign in to comment.