diff --git a/src/aihawk_easy_applier.py b/src/aihawk_easy_applier.py index ca30b4e7..a404b2e8 100644 --- a/src/aihawk_easy_applier.py +++ b/src/aihawk_easy_applier.py @@ -35,6 +35,7 @@ def __init__(self, driver: Any, resume_dir: Optional[str], set_old_answers: List self.gpt_answerer = gpt_answerer self.resume_generator_manager = resume_generator_manager self.all_data = self._load_questions_from_json() + self.current_job = None logger.debug("AIHawkEasyApplier initialized successfully") @@ -126,6 +127,8 @@ def job_apply(self, job: Any): job.set_recruiter_link(recruiter_link) logger.debug(f"Recruiter link set: {recruiter_link}") + self.current_job = job + logger.debug("Attempting to click 'Easy Apply' button") actions = ActionChains(self.driver) actions.move_to_element(easy_apply_button).click().perform() @@ -841,6 +844,9 @@ def _save_questions_to_json(self, question_data: dict) -> None: if self._sanitize_text(item['question']) == question_data['question'] and item['type'] == question_data['type']: logger.debug(f"Question already exists in answers.json. Aborting save of: {item['question']}") return + if self.current_job.company in item['answer']: + logger.debug(f"Answer contains the Company name. Aborting save of: {item['question']}") + return logger.debug(f"Saving question data to JSON: {question_data}") try: