EmailHarvester
EmailHarvester copied to clipboard
Code Improvements and Addition of New Features
Changes Documentation
1. Signal Handling Addition
- Added a signal handler to capture the SIGINT signal (Ctrl+C) and cancel the email search if the user wishes to interrupt it.
2. clean_html_tags
Method in myparser
Class
- The
genericClean
method was replaced by theclean_html_tags
method in themyparser
class. This was done to make the naming more descriptive and cohesive with the method's responsibility.
3. clean_special_characters
Method in myparser
Class
- A new method called
clean_special_characters
was added to themyparser
class. It is responsible for cleaning special characters from the results string, replacing them with whitespace.
4. Regex Change in emails
Method of myparser
Class
- The regex in the
emails
method was modified to use "raw" strings (prefixed withr
) to improve readability and avoid issues with backslashes in escape characters.
5. Exception Handling Addition in __init__
Method of EmailHarvester
Class
- Exception handling was added for plugin import and initialization. This ensures that any errors during these processes are captured and handled appropriately.
6. Redundant Exception Handling Removal
- Some blocks of code containing redundant exception handling were removed. For example, the
try-except
block around the call tor.raise_for_status()
in thedo_search
method of theEmailHarvester
class was removed, asrequests.get
already raises arequests.exceptions.HTTPError
exception if the response has an error status.