-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes made. #473
Changes made. #473
Conversation
@feder-cr After merging this PR, create a new release. |
|
||
parameters['uploads'] = FileManager.file_paths_to_dict(resume, plain_text_resume_file) | ||
parameters['outputFileDirectory'] = output_folder | ||
|
||
create_and_run_bot(parameters, llm_api_key) | ||
create_and_run_bot(email, password, parameters, llm_api_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main has too many unnecessary logs, and its making code unreadable. The raise error is sufficient in all the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use wrapper if we need to keep so many debug logs?
class LoggerWrapper:
def __init__(self, logger):
self.logger = logger
self.debug_mode = os.environ.get('DEBUG', 'False').lower() == 'true'
def debug(self, message, *args, **kwargs):
if self.debug_mode:
self.logger.debug(message, *args, **kwargs)
def info(self, message, *args, **kwargs):
self.logger.info(message, *args, **kwargs)
def __getattr__(self, name):
return getattr(self.logger, name)
def start(self): | ||
logger.info("Starting Chrome browser to log in to AIHawk.") | ||
logger.info("Starting Chrome browser to log in to LinkedIn.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this log could be misleading, as the browser depends on the engine. Wouldn't it be better to change to browser?
|
||
# Ожидание появления поля для ввода email | ||
logger.debug("Waiting for the email input field to be present...") | ||
email_field = WebDriverWait(self.driver, 15).until( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, could you explain this section. Especially why wait for 15 sec? Is this manual input ?
required_keys = { | ||
'remote': bool, | ||
'experienceLevel': dict, | ||
'experience_level': dict, | ||
'jobTypes': dict, | ||
'date': dict, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats this date? shouldn't it be in str, dict, tuple format?
phone: str | ||
email: str | ||
github: str | ||
linkedin: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this field be optional?
or have default value of NA
- github can be NA
- linkedin can be NA as some users may not be interested to provide
@@ -124,7 +124,7 @@ def _create_model(self, config: dict, api_key: str) -> AIModel: | |||
elif llm_model_type == "gemini": | |||
return GeminiModel(api_key, llm_model) | |||
elif llm_model_type == "huggingface": | |||
return HuggingFaceModel(api_key, llm_model) | |||
return HuggingFaceModel(api_key, llm_model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be wrapper in function for python 3.10
match llm_model_type:
case "openai":
return OpenAIModel(api_key, llm_model)
case "claude":
return ClaudeModel(api_key, llm_model)
case "ollama":
return OllamaModel(llm_model, llm_api_url)
case "gemini":
return GeminiModel(api_key, llm_model)
case "huggingface":
return HuggingFaceModel(api_key, llm_model)
case _:
raise ValueError(f"Unsupported model type: {llm_model_type}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made comments which i thought could improve readability. No obvious issues found on first glance. Didn't try running locally.
Great work. All changes look good |
@queukat can you merge with main? Because I want delete v4 for now |
Improvements:
New Method for Handling Pop-ups:
Added a new method handle_safety_reminder_modal to handle safety reminder modals and ensure smooth form submission without interruptions.
Resume Handling Logic Updated:
Introduced a new method is_resume_already_uploaded to check if a specific resume is already uploaded, avoiding unnecessary re-uploads.
Enhanced the logic to skip resume re-upload if it is already present, improving performance and avoiding duplicate uploads.
Error Handling Enhanced:
Updated error handling in various methods to provide more meaningful error messages and reduce code redundancy.
Improved logging and exception management in critical sections to help with debugging.
Modular Code Structure:
Some methods have been slightly refactored and broken down into smaller functions, making the code more modular and easier to read.
Additions:
Safety Reminder Handling:
Added code to detect and click the “Continue applying” button on the job safety reminder modal if it appears, ensuring the application process is not blocked.
Resume Check Mechanism:
Implemented logic to verify if a resume with a specific filename is already uploaded before attempting to upload it again.
Improved Button Handling:
Added code to handle cases where the Easy Apply button might be hidden or hard to interact with by using multiple search strategies (ActionChains and JavaScript).
Minor Fixes:
Improved Focus Management:
Added a few additional lines to remove focus from irrelevant elements (e.g., URL bar) to reduce interaction errors when clicking buttons.
Refined Textbox Handling:
Updated logic for textbox handling to include automatic dropdown selection after filling in text fields, ensuring values are correctly recognized by the system.
General Code Cleanup:
Removed some redundant lines and unnecessary error logs to streamline the overall code structure.
These changes enhance stability, improve automation reliability, and add mechanisms for better handling of unexpected modals and resume management.