This repository contains a Selenium script that automates the process of logging into a website and submitting job application details. The script is scheduled to run daily using GitHub Actions.
- Automates login to the specified website.
- Enters job application details for the date two days ago.
- Uses environment variables for secure credential management.
- Runs daily using GitHub Actions.
- Python 3.x
- A GitHub account
git clone https://github.com/mucahitkayadan/job_search_report_automation.git
cd job_search_report_automation
Create a file named requirements.txt
and add the following lines:
selenium~=4.21.0
webdriver-manager~=4.0.1
Create a file named script.py
and add your Selenium automation script to it. This script should use environment variables for credentials and automate the necessary steps on the website.
- Navigate to your GitHub repository.
- Go to Settings > Secrets and variables > Actions.
- Click New repository secret and add the following secrets:
MIU_EMAIL
: Your email address.MIU_PASSWORD
: Your password.
NOTE: If you are trying to run the code on your desktop, add your credentials to your local environment, or just basically set that values as text in the code. On Powershell:
setx MIU_EMAIL put_your_miu_email
setx MIU_PASSWORD put_your_miu_password
Create a directory named .github/workflows
in the root of your repository. Inside this directory, create a YAML file named main.yml
with the following content:
name: Run Selenium Script
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
jobs:
run-selenium-script:
runs-on: ubuntu-latest
env:
MIU_EMAIL: ${{ secrets.MIU_EMAIL }}
MIU_PASSWORD: ${{ secrets.MIU_PASSWORD }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Chrome
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable
- name: Install ChromeDriver
run: |
sudo apt-get install -y unzip
curl -sS -o chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$(curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip
unzip chromedriver_linux64.zip -d /usr/local/bin/
rm chromedriver_linux64.zip
- name: Verify environment variables
run: |
echo "MIU_EMAIL: $MIU_EMAIL"
echo "MIU_PASSWORD: $MIU_PASSWORD"
- name: Run Selenium script
run: |
python script.py
git add .
git commit -m "Add Selenium script and GitHub Actions workflow"
git push origin main
- Go to the Actions tab of your GitHub repository.
- Check the status of the workflow runs.
- Review logs to ensure everything is working correctly.
By following these steps, you have set up a Selenium script that runs daily using GitHub Actions. This script logs into a website, enters job application details, and submits the form. The setup ensures secure handling of credentials using GitHub Secrets.
Feel free to contribute and improve the script by submitting pull requests.