[Python] Fixing a Python script automating job applications on Indeed

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    Both as a first "coding" project using Python and as a potentially useful tool; I'm looking to automate the job application process on Indeed. I realise having the whole process of filling and uploading CV etc might be a bit too complicated- so for now I trying to get it to open each job posting in a new tab for me to fill out later.

    This script is supposed to open the "apply now" (postuler maintenant in FR) in a new tab; it runs and opens safari. However, it quits after a while and doesn't interact with the page. There is a "accept cookies" pop-up showing up. Might that be the issue?

    #!/usr/bin/env python3
    from selenium import webdriver
    import time

    class IndeedSpider:
    def __init__(self):
    self.driver = webdriver.Safari()

    def apply_to_jobs(self):
    self.driver.get('https://emplois.be.indeed.com/jobs?q=job+étudiant&l=Bruxelles&from=searchOnHP&vjk=8038d2843bbd3e80')
    self.driver.implicitly_wait(10) # Wait for the page to load

    apply_now_buttons = self.driver.find_elements("xpath", '//button[@aria-label="Postuler maintenant opens in a new tab"]')[:5]
    for button in apply_now_buttons:
    button.click()
    time.sleep(2) # Wait for the page to load after clicking

    # Instantiate the spider and apply to jobs
    spider = IndeedSpider()
    spider.apply_to_jobs()

    Continue reading...

Compartilhe esta Página