Skip to content

Commit

Permalink
no extra sleeps
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Dec 11, 2023
1 parent 3c937d5 commit 3fed6f8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions glvrd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __del__(self) -> None:

def get_driver(self) -> webdriver.Chrome:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
#options.add_argument('--headless')
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=options)
return driver

Expand All @@ -55,16 +55,13 @@ def estimate_something(self, text: str, sleep_before_result: Union[int, float])
action = webdriver.ActionChains(self.driver)

for text_block in self.page.full_input_field:
time.sleep(0.01)
for highlighted_text_element in text_block.find_elements(By.XPATH, ".//em"):
time.sleep(0.01)
highlighted_text = highlighted_text_element.text
action.move_to_element(highlighted_text_element).perform()
error_name = self.page.highlighted_error_name.text
if result.errors.get(error_name) is None:
result.errors[error_name] = []
result.errors[error_name].append(highlighted_text)
time.sleep(0.01)

return result

Expand Down

0 comments on commit 3fed6f8

Please sign in to comment.