GabeGiro / EasyApplyJobsBot

Automated bot that applies to Linkedin jobs via Easy Apply based on your preferences
https://discord.gg/y9fC2snanK
MIT License
19 stars 6 forks source link

Some jobItems don't contain companyNameSpan #43

Open GabeGiro opened 3 months ago

GabeGiro commented 3 months ago

The jobItems that don't contain companyNameSpan shouldn't exist. This issue needs further investigation to why this happens.

Here is the snippet of the code where the issue can be debugged:

            companyNameSpan = jobItem.find_elements(By.XPATH, ".//span[contains(@class, 'job-card-container__primary-description')]")
            if companyNameSpan:
                full_description = companyNameSpan[0].text.strip()

                if '·' in full_description:
                    companyName = full_description.split('·')[0].strip()
                else:
                    companyName = full_description

                if self.isCompanyBlacklisted(companyName):
                    if config.displayWarnings:
                        prYellow(f"⚠️  Not adding a job as the company '{companyName}' is blacklisted")
                    continue

            if companyName is None:
                utils.logDebugMessage("Couldn't find companyName", utils.MessageTypes.WARNING)
                continue