Skip to content

Commit

Permalink
facebook: add check if browser is supported
Browse files Browse the repository at this point in the history
this is usually the user agent string
  • Loading branch information
naisanzaa committed Oct 15, 2024
1 parent 332b58e commit 5cdee01
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion automon/integrations/facebook/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ def blocked_by_login(self):
except Exception as error:
logger.error(error)

def browser_not_supported(self):
try:
element = self._browser.wait_for_anything(
match='This browser is not supported',
value='div',
by=self._browser.by.TAG_NAME,
exact_match=True
)
if element:
element = element[0]
element = element.text
logger.debug(self._browser.user_agent)
logger.debug(element)
return element
except Exception as error:
logger.error(error)


def close_login_popup(self):
try:
button = self._browser.find_anything(
Expand Down Expand Up @@ -569,7 +587,8 @@ def to_dict(self):
title=self.title(),
url=self.url,
visible=self.visible(),
blocked_by_login=self.blocked_by_login()
blocked_by_login=self.blocked_by_login(),
browser_not_supported=self.browser_not_supported()
)

def quit(self):
Expand Down

0 comments on commit 5cdee01

Please sign in to comment.