Skip to content
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

Hawk does not apply for jobs. linkedIn_job_manager does not work properly #114

Closed
pafthinder opened this issue Aug 28, 2024 · 13 comments
Closed
Labels
bug Something isn't working

Comments

@pafthinder
Copy link

  • scrolls up down the left panel (the one with suggested offers when my criterion is not met)
  • does not recognize that it has not found any offer
  • or even if there are offers - does not apply for them, does not interact with the right panel in any way
  • claims that it is applying for jobs on this site (and there are none here)
  • claims to apply for jobs on this page (and even if there are any, it skips them)
  • even if the “easy apply” button occurs - does not click on it
  • gets hung up on one job offer and flies around 20 pages, doing the same thing all the time i.e. going to the exact same nth page (but calls it n+1) and then finding nothing, pretending to apply.... and so on ad infinitum

both content and linkedIn language are english
I tried to change to dark mode, but it's not possible, huh. even though I changed it when browser is opened by script light mode somehow returns

Screenshot_2.png - scrolls to the bottom
Screenshot_3.png - exactly the same behavior (scrolling to the bottom) even if there are no jobs meeting criteria
Screenshot_4.png - scrolls to the top, continuing to the next "page" (even though in the current one there were no offers)

Starting Chrome browser to log in to LinkedIn.
User is already logged in.
Starting the search for IT Project Manager in Barcelona, Catalonia, Spain.
Going to job page 0
Starting the application process for this page...
Applying to jobs on this page has been completed!
Going to job page 1
Starting the application process for this page...
The element is not scrollable.
The element is not scrollable.
Starting the search for Technical Product Manager in Krakow, Malopolskie, Poland.
Going to job page 0
Starting the application process for this page...
Applying to jobs on this page has been completed!
Going to job page 1
Starting the application process for this page...
The element is not scrollable.
The element is not scrollable.
Starting the search for Data Development Product Owner in Barcelona, Catalonia, Spain.
Going to job page 0
Starting the application process for this page...
Applying to jobs on this page has been completed!
Sleeping for 0.08333333333333333 minutes.
Going to job page 1
Starting the application process for this page...
Applying to jobs on this page has been completed!
Going to job page 2
Starting the application process for this page...
Applying to jobs on this page has been completed!
Going to job page 3
Starting the application process for this page...

Screenshot_2
Screenshot_3
Screenshot_4

please help. Ask any further questions for clarification, I will gladly provide more information. Lemme know if I can help somehow.

Regards,
Simon

@iliasjaddi
Copy link

Me too! It's not applying to any jobs!

@pafthinder
Copy link
Author

I think it has something to do with the layout of LinkedIn page ; for some people layout ( therefore class names like this
link = job_tile.find_element(By.CLASS_NAME, 'job-card-list__title').get_attribute('href').split('?')[0] ) is compatible and for some is not

but what's the pattern here?
I have shown my layout above. it looks pretty... basic I would say.

any idea will be appreciated

@pafthinder
Copy link
Author

I have LinkedIn learning subscription, maybe that changes whole layout of LI page and therefore markups are misaligned?
@iliasjaddi - do you have LI premium or LI learning subscription?

@pafthinder
Copy link
Author

there is problem in apply_jobs method of LinkedInJobManager class (linkedIn_job_manager.py @ 127)

job_list_elements = self.driver.find_elements(By.CLASS_NAME, 'scaffold-layout__list-container')[0].find_elements(By.CLASS_NAME, 'jobs-search-results__list-item occludable-update p0 relative scaffold-layout__list-item')
job_list_elements remains empty (I updated CLASS_NAME in my code for testing purpose, no luck with this, nor orignal CLASS_NAME)

but if we look one level higher using
job_list_elements_debug = self.driver.find_elements(By.CLASS_NAME, 'scaffold-layout__list-container')[0]

we can see its being filled with data
image

so there is some issue with find_elements in 0th element of job_list_elements

I tried to access text from job_list_elements
job_list_elements = self.driver.find_elements(By.CLASS_NAME, 'scaffold-layout__list-container')[0].text

but it doesn't pass what's necessary to
job_list = [Job(*self.extract_job_information_from_tile(job_element)) for job_element in job_list_elements]

@feder-cr
please take a look in a spare moment, thanks.

@pafthinder
Copy link
Author

Going to job page 0
Starting the application process for this page...
The element is not scrollable.
The element is not scrollable.
Starting the search for Technical Support in Wroclaw Metropolitan Area.
Going to job page 0
Starting the application process for this page...
The element is not scrollable.
The element is not scrollable.
Starting the search for Technical Support in Vienna, Austria.
Going to job page 0
Starting the application process for this page...
The element is not scrollable.
The element is not scrollable.
Starting the search for Technical Support in Amsterdam Area.
Going to job page 0
Starting the application process for this page...

unpredictable behavior here. no matter if it finds jobs in the left pane or it doesn't, it does one of 2 actions

@pafthinder
Copy link
Author

I have managed to send my first automated application using this altered code
apply_jobs() and extract_job_information_from_tile() functions are updated @ linkedIn_job_manager.py
still it gets pretty buggy

use at ur own responsibility and lemme know if it helps in ur case

   def apply_jobs(self):
        try:
            # Wait for the job list container to be present
            WebDriverWait(self.driver, 10).until(
                EC.presence_of_element_located((By.CLASS_NAME, "scaffold-layout__list-container"))
            )
            
            # Find the job list container
            job_list_container = self.driver.find_element(By.CLASS_NAME, "scaffold-layout__list-container")
            
            # Find all job items within the container
            job_list_elements = job_list_container.find_elements(By.CSS_SELECTOR, 
                "li.ember-view.jobs-search-results__list-item.occludable-update.p0.relative.scaffold-layout__list-item")
            
            print(f"Number of job elements found: {len(job_list_elements)}")
            
            if not job_list_elements:
                raise Exception("No job elements found on page")
            
            for job_element in job_list_elements:
                job = Job(*self.extract_job_information_from_tile(job_element))
                print(f"Processing job: {job.title} at {job.company}")
                if self.is_blacklisted(job.title, job.company, job.link):
                    utils.printyellow(f"Blacklisted {job.title} at {job.company}, skipping...")
                    self.write_to_file(job, "skipped")
                    continue
                try:
                    if job.apply_method not in {"Continue", "Applied", "Apply"}:
                        self.easy_applier_component.job_apply(job)
                        self.write_to_file(job, "success")
                    else:
                        utils.printyellow(f"Skipping {job.title} due to apply method: {job.apply_method}")
                except Exception as e:
                    utils.printred(f"Error applying to {job.title}: {str(e)}")
                    utils.printred(traceback.format_exc())
                    self.write_to_file(job, "failed")
                    continue
        except Exception as e:
            utils.printred(f"Error in apply_jobs: {str(e)}")
            utils.printred(traceback.format_exc())

# Update the extract_job_information_from_tile method
    def extract_job_information_from_tile(self, job_tile):
        job_title, company, job_location, apply_method, link = "", "", "", "", ""
        try:
            job_title = job_tile.find_element(By.CSS_SELECTOR, 'a.job-card-list__title').text
            link = job_tile.find_element(By.CSS_SELECTOR, 'a.job-card-list__title').get_attribute('href').split('?')[0]
            company = job_tile.find_element(By.CSS_SELECTOR, '.job-card-container__primary-description').text
            job_location = job_tile.find_element(By.CSS_SELECTOR, '.job-card-container__metadata-item').text
            apply_method = job_tile.find_element(By.CSS_SELECTOR, '.job-card-container__apply-method').text
        except NoSuchElementException as e:
            print(f"Error extracting job information: {str(e)}")
        
        return job_title, company, job_location, link, apply_method

@azjz92 azjz92 added the bug Something isn't working label Aug 31, 2024
@feder-cr
Copy link
Owner

feder-cr commented Sep 3, 2024

@Andres-Ventura this is the same error?

@Antharithm
Copy link

Is it possible to reduce the sleeping time? 800 seconds between jobs adds up

@pafthinder
Copy link
Author

yes it is, linkedIn_job_manager -> start_applying() -> minimum_time

@feder-cr feder-cr closed this as completed Sep 8, 2024
@pafthinder
Copy link
Author

how is that completed?

@feder-cr feder-cr reopened this Sep 12, 2024
This was referenced Sep 27, 2024
@queukat
Copy link
Collaborator

queukat commented Oct 8, 2024

fixed in #473

@jcl0251
Copy link

jcl0251 commented Oct 12, 2024

fixed in #473

What was fixed? I've been trying to get this fixed. It runs but either fails or skips for the applications.

I've tried running off of your version, but I'm getting other errors now.

@feder-cr
Copy link
Owner

@pafthinder @iliasjaddi @Antharithm @jcl0251 join the telegram group, so we can discuss it more easily - > https://t.me/AIhawkCommunity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants