diff --git a/.gitignore b/.gitignore index 2d34995..21ead07 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ generated_cv* resume.html .vscode chrome_profile -lib* \ No newline at end of file +lib* +answers.json diff --git a/main.py b/main.py index 2028866..9685677 100644 --- a/main.py +++ b/main.py @@ -9,12 +9,12 @@ from selenium.webdriver.chrome.service import Service as ChromeService from webdriver_manager.chrome import ChromeDriverManager from selenium.common.exceptions import WebDriverException, TimeoutException from lib_resume_builder_AIHawk import Resume,StyleManager,FacadeManager,ResumeGenerator -from utils import chromeBrowserOptions -from gpt import GPTAnswerer -from linkedIn_authenticator import LinkedInAuthenticator -from linkedIn_bot_facade import LinkedInBotFacade -from linkedIn_job_manager import LinkedInJobManager -from job_application_profile import JobApplicationProfile +from src.utils import chromeBrowserOptions +from src.gpt import GPTAnswerer +from src.linkedIn_authenticator import LinkedInAuthenticator +from src.linkedIn_bot_facade import LinkedInBotFacade +from src.linkedIn_job_manager import LinkedInJobManager +from src.job_application_profile import JobApplicationProfile # Suppress stderr sys.stderr = open(os.devnull, 'w') diff --git a/gpt.py b/src/gpt.py similarity index 99% rename from gpt.py rename to src/gpt.py index 368572c..5794cca 100644 --- a/gpt.py +++ b/src/gpt.py @@ -13,7 +13,7 @@ from langchain_core.prompts import ChatPromptTemplate from langchain_openai import ChatOpenAI from Levenshtein import distance -import strings +import src.strings as strings load_dotenv() diff --git a/job_application_profile.py b/src/job_application_profile.py similarity index 100% rename from job_application_profile.py rename to src/job_application_profile.py diff --git a/linkedIn_authenticator.py b/src/linkedIn_authenticator.py similarity index 100% rename from linkedIn_authenticator.py rename to src/linkedIn_authenticator.py diff --git a/linkedIn_bot_facade.py b/src/linkedIn_bot_facade.py similarity index 100% rename from linkedIn_bot_facade.py rename to src/linkedIn_bot_facade.py diff --git a/linkedIn_easy_applier.py b/src/linkedIn_easy_applier.py similarity index 99% rename from linkedIn_easy_applier.py rename to src/linkedIn_easy_applier.py index 48f8bf4..0243681 100644 --- a/linkedIn_easy_applier.py +++ b/src/linkedIn_easy_applier.py @@ -17,7 +17,7 @@ from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver import ActionChains -import utils +import src.utils as utils class LinkedInEasyApplier: def __init__(self, driver: Any, resume_dir: Optional[str], set_old_answers: List[Tuple[str, str, str]], gpt_answerer: Any, resume_generator_manager): diff --git a/linkedIn_job_manager.py b/src/linkedIn_job_manager.py similarity index 99% rename from linkedIn_job_manager.py rename to src/linkedIn_job_manager.py index e6f2940..6190df0 100644 --- a/linkedIn_job_manager.py +++ b/src/linkedIn_job_manager.py @@ -6,9 +6,9 @@ from itertools import product from pathlib import Path from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By -import utils +import src.utils as utils from job import Job -from linkedIn_easy_applier import LinkedInEasyApplier +from src.linkedIn_easy_applier import LinkedInEasyApplier import json diff --git a/strings.py b/src/strings.py similarity index 100% rename from strings.py rename to src/strings.py diff --git a/utils.py b/src/utils.py similarity index 91% rename from utils.py rename to src/utils.py index bc5cbea..ea7c07b 100644 --- a/utils.py +++ b/src/utils.py @@ -50,7 +50,7 @@ def scroll_slow(driver, scrollable_element, start=0, end=3600, step=100, reverse def chromeBrowserOptions(): ensure_chrome_profile() options = webdriver.ChromeOptions() - """options.add_argument("--start-maximized") # Avvia il browser a schermo intero + options.add_argument("--start-maximized") # Avvia il browser a schermo intero options.add_argument("--no-sandbox") # Disabilita la sandboxing per migliorare le prestazioni options.add_argument("--disable-dev-shm-usage") # Utilizza una directory temporanea per la memoria condivisa options.add_argument("--ignore-certificate-errors") # Ignora gli errori dei certificati SSL @@ -63,7 +63,6 @@ def chromeBrowserOptions(): options.add_argument("--disable-popup-blocking") # Disabilita il blocco dei popup options.add_argument("--no-first-run") # Disabilita la configurazione iniziale del browser options.add_argument("--no-default-browser-check") # Disabilita il controllo del browser predefinito - options.add_argument("--single-process") # Esegui Chrome in un solo processo options.add_argument("--disable-logging") # Disabilita il logging options.add_argument("--disable-autofill") # Disabilita l'autocompletamento dei moduli options.add_argument("--disable-plugins") # Disabilita i plugin del browser @@ -84,11 +83,8 @@ def chromeBrowserOptions(): options.add_argument('--user-data-dir=' + initialPath) options.add_argument("--profile-directory=" + profileDir) else: - options.add_argument("--incognito")""" - initialPath = os.path.dirname(chromeProfilePath) - profileDir = os.path.basename(chromeProfilePath) - options.add_argument('--user-data-dir=' + initialPath) - options.add_argument("--profile-directory=" + profileDir) + options.add_argument("--incognito") + return options