diff --git a/linkedIn_easy_applier.py b/linkedIn_easy_applier.py index bf931b3..ae60432 100644 --- a/linkedIn_easy_applier.py +++ b/linkedIn_easy_applier.py @@ -23,7 +23,7 @@ class LinkedInEasyApplier: if resume_dir is None or not os.path.exists(resume_dir): resume_dir = None self.driver = driver - self.resume_dir = resume_dir + self.resume_path = resume_dir self.set_old_answers = set_old_answers self.gpt_answerer = gpt_answerer self.resume_generator_manager = resume_generator_manager @@ -154,12 +154,10 @@ class LinkedInEasyApplier: self.driver.execute_script("arguments[0].classList.remove('hidden')", element) output = self.gpt_answerer.resume_or_cover(parent.text.lower()) if 'resume' in output: - if self.resume_dir: - resume_path = self.resume_dir.resolve() - if resume_path.exists() and resume_path.is_file(): - element.send_keys(str(resume_path)) - else: - self._create_and_upload_resume(element, job) + if self.resume_path is not None and self.resume_path.resolve().is_file(): + element.send_keys(str(self.resume_path.resolve())) + else: + self._create_and_upload_resume(element, job) elif 'cover' in output: self._create_and_upload_cover_letter(element) diff --git a/linkedIn_job_manager.py b/linkedIn_job_manager.py index af17877..bb36f7f 100644 --- a/linkedIn_job_manager.py +++ b/linkedIn_job_manager.py @@ -40,9 +40,9 @@ class LinkedInJobManager: self.seen_jobs = [] resume_path = parameters.get('uploads', {}).get('resume', None) if resume_path is not None and Path(resume_path).exists(): - self.resume_dir = Path(resume_path) + self.resume_path = Path(resume_path) else: - self.resume_dir = None + self.resume_path = None self.output_file_directory = Path(parameters['outputFileDirectory']) self.env_config = EnvironmentKeys() #self.old_question() @@ -66,7 +66,7 @@ class LinkedInJobManager: def start_applying(self): - self.easy_applier_component = LinkedInEasyApplier(self.driver, self.resume_dir, self.set_old_answers, self.gpt_answerer, self.resume_generator_manager) + self.easy_applier_component = LinkedInEasyApplier(self.driver, self.resume_path, self.set_old_answers, self.gpt_answerer, self.resume_generator_manager) searches = list(product(self.positions, self.locations)) random.shuffle(searches) page_sleep = 0