Skip to content

Commit

Permalink
Merge pull request #544 from skmdfardin/feature/country-code-fix
Browse files Browse the repository at this point in the history
added detection for country code field which was previously defaulted to first option element under the select element
  • Loading branch information
feder-cr authored Oct 16, 2024
2 parents 1781092 + f9cc024 commit 87e0e5b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/aihawk_easy_applier.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,16 @@ def _handle_dropdown_fields(self, element: WebElement) -> None:

dropdown = element.find_element(By.TAG_NAME, 'select')
select = Select(dropdown)
dropdown_id = dropdown.get_attribute('id')
if 'phoneNumber-Country' in dropdown_id:
country = self.resume_generator_manager.get_resume_country()
if country:
try:
select.select_by_value(country)
logger.debug(f"Selected phone country: {country}")
return True
except NoSuchElementException:
logger.warning(f"Country {country} not found in dropdown options")

options = [option.text for option in select.options]
logger.debug(f"Dropdown options found: {options}")
Expand All @@ -372,7 +382,6 @@ def _handle_dropdown_fields(self, element: WebElement) -> None:
if existing_answer:
logger.debug(f"Found existing answer for question '{question_text}': {existing_answer}")
else:

logger.debug(f"No existing answer found, querying model for: {question_text}")
existing_answer = self.gpt_answerer.answer_question_from_options(question_text, options)
logger.debug(f"Model provided answer: {existing_answer}")
Expand Down

0 comments on commit 87e0e5b

Please sign in to comment.