Web scraping

Python Django job scraper workflow with BeautifulSoup, TimesJobs, and Google Sheets integration.

How I Built a Django Job Scraper that Saves to Google Sheets

Last month, I got stuck in the usual routine: job boards were checked by hand, listings were copied into spreadsheets, and the best opportunities were always missed. After too many hours were spent on this boring work, a thought came up – why not have the whole process automated? So, I started thinking about creating a Django project that could scrape and automate job listings from websites like LinkedIn and Indeed. However, after trying multiple ways to scrape data from sites like Indeed, I got stuck because most big websites have bot protections that prevent scraping. I even tried using Selenium, but it didn’t work reliably. Ultimately, I used BeautifulSoup4 and the requests library to extract the data. I scraped data from the TimesJobs website and saved it both in a Google Sheet and in a Django SQLite database. The Problem That Drove Me Crazy Every morning, I would open 5–6 different job boards, search for the same keywords, scroll through hundreds of listings, and manually copy the good ones into my tracking spreadsheet. By the time I was done, I was already mentally exhausted—before even starting to write cover letters. The worst part? I kept missing jobs that were posted while I was sleeping or busy with other tasks. Some great opportunities would disappear before I even got a chance to see them. I knew there had to be a better way. What I Built (And Why It Actually Works) My solution is pretty straightforward: a Python script, built with Django, that automatically scrapes job listings from multiple sources and saves everything into a Google Sheet and a SQLite database. But here’s what makes it actually useful: The Tech Stack (Nothing Too Fancy) I kept things simple because, honestly, I wanted something I could maintain without pulling my hair out: Lessons I Learned the Hard Way Rate limiting is real: I got blocked from a few sites in the first week because I was being too aggressive with requests. Had to add delays and retry logic. Websites change their structure: What worked perfectly in January broke in February when one site redesigned its job listing pages. Now I build in more flexibility from the start. Google Sheets API has quotas: You can’t just hammer their API endlessly. I learned to batch my updates and cache data locally. Job descriptions are messy: The amount of inconsistent HTML and weird formatting in job posts is honestly astounding. Cleaning this data took way more time than I expected. Want to Build Your Own? Here’s a step-by-step guide to building a Django project that scrapes job listings using BeautifulSoup4 and requests, and saves the data in both Google Sheets and your Django models: 1. Set Up Your Django Project pip install django django-admin startproject jobscraper cd jobscraper python manage.py startapp jobs 2. Create Your Job Model Define a model to store job listings in jobs/models.py: from django.db import models class Job(models.Model): title = models.CharField(max_length=255) company = models.CharField(max_length=255, blank=True, null=True) location = models.CharField(max_length=255, blank=True, null=True) experience = models.CharField(max_length=100, blank=True, null=True) salary = models.CharField(max_length=100, blank=True, null=True) posted = models.CharField(max_length=100, blank=True, null=True) description = models.TextField(blank=True, null=True) skills = models.TextField(blank=True, null=True) # store as comma-separated string link = models.URLField(unique=True) # prevent duplicates created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return f”{self.title} at {self.company}” python manage.py makemigrations python manage.py migrate 3. Scrape Job Listings with BeautifulSoup4 and Requests pip install beautifulsoup4 requests gspread oauth2client def scrape_jobs(): url = “https://www.timesjobs.com/candidate/job-search.html?searchType=personalizedSearch&from=submit&txtKeywords=Python+developer&txtLocation=India” response = requests.get(url, headers={“User-Agent”: “Mozilla/5.0”}) soup = BeautifulSoup(response.text, “html.parser”) container = soup.find(“ul”, class_=”new-joblist”) if not container: print(“No job list found!”) return [] cards = container.find_all(“li”, class_=”clearfix job-bx wht-shd-bx”) print(f”Found {len(cards)} jobs”) jobs = [] for card in cards: job_data = parse_job_card(card) # Save if not exists if not Job.objects.filter(link=job_data[“link”]).exists(): Job.objects.create( title=job_data[“title”], company=job_data[“company”], location=job_data[“location”], experience=job_data[“experience”], salary=job_data[“salary”], posted=job_data[“posted”], description=job_data[“description”], skills=”, “.join(job_data[“skills”]), # convert list to string link=job_data[“link”], ) jobs.append(job_data) return jobs 4. Save Data to Google Sheets Log in to your Gmail and open Google Cloud. Create a New Project and Enable Google Sheets API and Google Drive API. Create Service Account Credentials. Generate a JSON Key File. Share your Google Sheet with the Service Account email as editor. import gspread from oauth2client.service_account import ServiceAccountCredentials from django.conf import settings def get_google_sheet(): scope = [“https://spreadsheets.google.com/feeds”, “https://www.googleapis.com/auth/drive”] creds = ServiceAccountCredentials.from_json_keyfile_name( settings.GOOGLE_SHEET_CREDENTIALS, scope ) client = gspread.authorize(creds) sheet = client.open(settings.GOOGLE_SHEET_NAME).sheet1 return sheet def update_sheet(job_data): sheet = get_google_sheet() existing = sheet.get_all_values() existing_links = {row[3] for row in existing[1:]} if len(existing) > 1 else set() # Add header if sheet is empty if not existing: sheet.append_row([“Title”, “Company”, “Location”, “Link”]) for job in job_data: if job[“link”] not in existing_links: # avoid duplicates sheet.append_row([job[“title”], job[“company”], job[“location”], job[“link”]]) 5. Automate It You can run the scraper periodically using Django management commands or a cron job. See the full code I have shared my full code download here: Final Thoughts Building this scraper turned out to be one of those projects that felt much more complicated at the start than it actually was. The hardest part was simply taking the first step. If you’re spending hours manually tracking job postings, I’d strongly recommend automating the process. Your future self will thank you—and you’ll have more energy to focus on what truly matters: writing strong applications and preparing for interviews. Have you automated any part of your job search? I’d love to hear about your experiences in the comments below.

How I Built a Django Job Scraper that Saves to Google Sheets Read More »

The Power of Python: Real-World Project Ideas illustrated with laptop, Python logo, and project icons.

The Power of Python: Real-World Project Ideas

When people ask why I love Python, my answer is simple: it’s not just a programming language, it’s a toolbox for turning my ideas into reality. Python is beginner-friendly, versatile, and powerful enough to run everything from a tiny script on your laptop to large-scale systems powering global companies. But here’s the catch: learning Python by just reading syntax or following tutorials can feel… incomplete. The real magic happens when you build real-time projects, things you can see, use, and maybe even share with others. Projects push you to connect concepts, face real challenges, and gain the confidence that you’re not just “learning Python,” you’re using it. So, let’s talk about some real-world project ideas you can start with, depending on your interests. Use FastAPI for real-time chat, and django is the best framework for other projects. 1. Email and file automation Repetitive tasks are the enemy of productivity. Luckily, Python is perfect for automating them. You’ll be surprised at how empowering it feels when your code saves you time in the real world. 2. Blog Website Every developer needs a place to share their thoughts, projects, and journey. Why not build your own blog? The bonus? You learn backend logic and how to make something visually appealing. Plus, it doubles as your portfolio. 3. E-Commerce with Payment Integration Imagine running your mini Amazon-style site built with Python! This type of project will expose you to real-world concepts like authentication, databases, and secure transactions, things every serious developer should know. 4. Social Media App Social media powers our world. Building even a simplified version teaches you so much. You don’t need to reinvent Instagram or Twitter. Even a basic version is a fantastic learning experience in how large-scale platforms actually work. 5. Real-Time Chat App with WebSockets Chat apps are a perfect introduction to real-time communication. It’s one of those projects that feels “alive” because you’re building something interactive. 6. Data Analysis & Visualization Python shines when it comes to working with data. This isn’t just coding—it’s storytelling with data. Use streamlit for data visualization. 7. Movie Recommendation System This one’s always a crowd pleaser. It’s a cool project because people can actually interact with it, and it’s a great intro to AI without being overwhelming. 8. Fun & Creative Projects Not every project has to be “serious.” Some of the best learning happens when you’re just having fun. Quirky projects often keep you motivated when the “serious” ones get too heavy. Final Thoughts Python is powerful not because it’s the fastest or most complex language, but because it’s accessible and opens doors to so many areas of automation, web, data, AI, and even fun side projects. The best advice I can give is this: start small, but start today. Pick one idea from the list above and build it. It doesn’t have to be perfect; in fact, it won’t be perfect. And that’s the point. Every project teaches you something new. Before long, you’ll have a portfolio that doesn’t just show code, it shows creativity, problem-solving. Let me know which project you’re creating.

The Power of Python: Real-World Project Ideas Read More »

Scroll to Top