Skip to content

Commit

Permalink
Merge pull request #582 from xTaylorFerg/fix-564
Browse files Browse the repository at this point in the history
  • Loading branch information
feder-cr authored Oct 22, 2024
2 parents 11b05a6 + 33f1826 commit fa0fd7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/aihawk_easy_applier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit fa0fd7f

Please sign in to comment.