mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-06-06 11:05:26 +00:00
fix : exception in browser
This commit is contained in:
parent
ac5118c4e3
commit
5321dcc3ba
@ -270,9 +270,13 @@ class Browser:
|
||||
raise e
|
||||
|
||||
def find_all_inputs(self, timeout=3):
|
||||
WebDriverWait(self.driver, timeout).until(
|
||||
EC.presence_of_element_located((By.TAG_NAME, "body"))
|
||||
)
|
||||
try:
|
||||
WebDriverWait(self.driver, timeout).until(
|
||||
EC.presence_of_element_located((By.TAG_NAME, "body"))
|
||||
)
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error waiting for input element: {str(e)}")
|
||||
return []
|
||||
time.sleep(0.5)
|
||||
script = self.load_js("find_inputs.js")
|
||||
input_elements = self.driver.execute_script(script)
|
||||
@ -359,6 +363,9 @@ class Browser:
|
||||
except TimeoutException:
|
||||
self.logger.warning(f"Timeout waiting for '{button_text}' button at XPath: {xpath}")
|
||||
return False
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error clicking button '{button_text}' at XPath: {xpath} - {str(e)}")
|
||||
return False
|
||||
self.logger.warning(f"No button matching '{btn_type}' found")
|
||||
return False
|
||||
|
||||
|
@ -93,6 +93,8 @@ class Interaction:
|
||||
self.recorder.join()
|
||||
self.transcriber.join()
|
||||
query = self.transcriber.get_transcript()
|
||||
if query == "exit" or query == "goodbye":
|
||||
return None
|
||||
return query
|
||||
|
||||
def get_user(self) -> str:
|
||||
|
Loading…
x
Reference in New Issue
Block a user