Skip to content

Commit

Permalink
reuse extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTpat committed Oct 13, 2024
1 parent dd734b6 commit e9efa34
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/aihawk_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(self, driver):
self.driver = driver
self.set_old_answers = set()
self.easy_applier_component = None
self.extractor = None
logger.debug("AIHawkJobManager initialized successfully")

def set_parameters(self, parameters):
Expand Down Expand Up @@ -217,11 +218,15 @@ def get_jobs_from_page(self):

def apply_jobs(self):
job_list = []
for e in EXTRACTORS:
extracted_jobs = e.get_job_list(self.driver)
if len(extracted_jobs) > 0:
job_list = extracted_jobs # break when we find a valid extractor
break
if self.extractor is not None: # we found a working extractor
job_list = self.extractor.get_job_list(self.driver)
else:
for e in EXTRACTORS:
extracted_jobs = e.get_job_list(self.driver)
if len(extracted_jobs) > 0:
job_list = extracted_jobs # break when we find a valid extractor
self.extractor = e
break

for job in job_list:

Expand Down

0 comments on commit e9efa34

Please sign in to comment.