This commit is contained in:
piair
2023-06-24 16:39:42 +02:00
parent f098f13242
commit 4b0f33ae26
4 changed files with 51 additions and 12 deletions

View File

@ -4,6 +4,41 @@ from modules.tools import *
import modules.globals as g
def set_language(ldriver):
ldriver.get("chrome://settings/languages")
action = ActionChains(ldriver)
action.reset_actions()
# select langage
x_coord = 1200
y_coord = 150
action.move_by_offset(x_coord, y_coord).click().perform()
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()
x_coord = 1163
y_coord = 717
action.move_by_offset(x_coord, y_coord).click().perform()
# put to the top
sleep(0.5)
action.reset_actions()
x_coord = 1257
y_coord = 328
action.move_by_offset(x_coord, y_coord).click().perform()
action.click().perform()
def setup_proxy(ip: str, port: str) -> None:
PROXY = f"{ip}:{port}"
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {

View File

@ -21,6 +21,7 @@ from selenium.common.exceptions import (ElementClickInterceptedException,
NoSuchElementException,
StaleElementReferenceException,
TimeoutException, WebDriverException)
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.options import Options