diff --git a/modules/driver_tools.py b/modules/driver_tools.py index 33b316b..2d3becf 100644 --- a/modules/driver_tools.py +++ b/modules/driver_tools.py @@ -15,18 +15,12 @@ def set_language(ldriver): sleep(0.5) # scroll down action.reset_actions() - x_coord = 1210 - y_coord = 430 - action.move_by_offset(x_coord, y_coord).click().perform() - for i in range(5): - action.click().perform() - # choose french - action.reset_actions() - x_coord = 745 - y_coord = 572 - action.move_by_offset(x_coord, y_coord).click().perform() - # enter - action.reset_actions() + elm = ldriver.find_element(By.XPATH, "/html/body") + ActionChains(ldriver)\ + .send_keys("french")\ + .pause(0.5)\ + .send_keys(Keys.TAB + Keys.TAB + Keys.ENTER + Keys.TAB + Keys.TAB + Keys.ENTER)\ + .perform() x_coord = 1163 y_coord = 717 action.move_by_offset(x_coord, y_coord).click().perform()