This commit is contained in:
feder-cr 2024-08-23 20:02:45 +01:00
parent 27100f3455
commit 06b176aa37
10 changed files with 15 additions and 18 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ resume.html
.vscode
chrome_profile
lib*
answers.json

12
main.py
View File

@ -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')

View File

@ -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()

View File

@ -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):

View File

@ -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

View File

@ -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