DeveloperBreeze

I Made $10,000 from a Simple Python Script—Here’s How!

How It All Started

A few months ago, I was just experimenting with Python, trying to automate small tasks and solve problems. I never expected that one of these little scripts would end up making me over $10,000. But that’s exactly what happened.

Here’s the full story of how a simple idea turned into a surprisingly profitable project.


The Problem I Solved

I realized that many businesses and individuals struggle with data extraction. Whether it’s scraping pricing data, gathering leads, or automating repetitive web tasks, people were willing to pay for an easy solution.

So I built a simple Python script that could scrape data from websites and save it in a CSV file. No fancy interface, no complex setup—just a straightforward tool that did the job.


The Tech Stack & How I Built It

I kept it simple and used:

  • Python
  • requests for sending HTTP requests
  • BeautifulSoup for parsing HTML
  • pandas for organizing and exporting data
  • Flask (optional) to turn it into a basic API

The Core Script

import requests
from bs4 import BeautifulSoup
import pandas as pd

def scrape_website(url):
    response = requests.get(url)
    if response.status_code == 200:
        soup = BeautifulSoup(response.text, 'html.parser')
        data = []
        for item in soup.select('.some-class'):
            data.append(item.text.strip())
        df = pd.DataFrame(data, columns=['Extracted Data'])
        df.to_csv('output.csv', index=False)
        print("Data saved to output.csv")
    else:
        print("Failed to retrieve data")

scrape_website('https://example.com')

This simple script extracts specific content from a webpage and saves it to a CSV file. With a few tweaks, it could be customized for different websites and data types.


How I Made Money From It

1. Freelancing on Fiverr & Upwork

I listed a gig offering custom web scraping scripts on Fiverr and Upwork. Within a week, I got my first few clients, each paying $50-$200 per script. The demand was bigger than I expected.

2. Selling a Pre-Built Version

Instead of writing custom scripts for every client, I made a generic scraper that could handle multiple websites. I put it up for sale on Gumroad and Sellix for $19.99, and people started buying it.

3. YouTube + Affiliate Marketing

I created a tutorial on "How to Scrape Websites with Python" and added an affiliate link to a web scraping API. Every time someone signed up, I got a commission.

4. Subscription Model (SaaS)

Eventually, I turned my script into a web app with Flask and hosted it on Heroku. I charged $9/month for unlimited scraping, and within a few months, I had over 50 active users paying for access.


What I Learned

  • Simple ideas can be profitable. You don’t need to build the next big startup to make money.
  • Marketing is just as important as coding. I promoted my work on Reddit, Twitter, and Discord developer communities.
  • Automate where you can. Instead of writing a new script for every client, I built a reusable tool and sold it multiple times.

You Can Do This Too

If you know how to code, there are plenty of ways to turn simple projects into real income. Find a problem, build a solution, and find the right people who need it.

What kind of script would you create?

Continue Reading

Handpicked posts just for you — based on your current read.

Build a Facial Recognition Attendance System

Use the saved encodings to identify individuals in real-time.

import cv2
import face_recognition
import pickle
from datetime import datetime

# Load encodings
with open("encodings.pickle", "rb") as f:
    data = pickle.load(f)

# Initialize webcam
video_capture = cv2.VideoCapture(0)

# Track attendance
attendance_log = set()

while True:
    ret, frame = video_capture.read()
    if not ret:
        break

    # Resize frame for faster processing
    small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
    rgb_frame = small_frame[:, :, ::-1]

    # Detect faces and compare
    face_locations = face_recognition.face_locations(rgb_frame)
    face_encodings = face_recognition.face_encodings(rgb_frame, face_locations)

    for face_encoding, face_location in zip(face_encodings, face_locations):
        matches = face_recognition.compare_faces(data["encodings"], face_encoding)
        name = "Unknown"

        if True in matches:
            match_index = matches.index(True)
            name = data["names"][match_index]

            # Log attendance
            if name not in attendance_log:
                attendance_log.add(name)
                print(f"{name} marked present at {datetime.now()}")

        # Display bounding box and name
        top, right, bottom, left = [v * 4 for v in face_location]
        cv2.rectangle(frame, (left, top), (right, bottom), (0, 255, 0), 2)
        cv2.putText(frame, name, (left, top - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)

    # Show video feed
    cv2.imshow("Attendance System", frame)

    if cv2.waitKey(1) & 0xFF == ord("q"):
        break

video_capture.release()
cv2.destroyAllWindows()

Dec 10, 2024 Tutorial

Automate Tweet Posting with a Python Twitter Bot

Let's create a Python script to automate tweet posting. Copy the following code into a new Python file (e.g., twitter_bot.py):

import tweepy
import time
from datetime import datetime, timedelta
import random

# Twitter API credentials
CONSUMER_KEY = 'your_consumer_key'
CONSUMER_SECRET = 'your_consumer_secret'
ACCESS_TOKEN = 'your_access_token'
ACCESS_TOKEN_SECRET = 'your_access_token_secret'

# Authenticate to Twitter
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)

# Create API object
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)

# List of tweets to post
tweets = [
    "Hello, Twitter! This is tweet number 1.",
    "Another day, another tweet! #Python",
    "Automating tweets with Python is fun!",
    "Tweeting at random times using Python.",
    # Add more tweets here
]

# Function to post a tweet
def post_tweet(tweet):
    try:
        api.update_status(tweet)
        print(f"Tweeted: {tweet}")
    except tweepy.TweepError as e:
        print(f"Error: {e.reason}")

# Schedule tweets
def schedule_tweets(tweets, num_tweets=20, hours_range=(8, 22)):
    today = datetime.now()
    start_time = today.replace(hour=hours_range[0], minute=0, second=0, microsecond=0)
    end_time = today.replace(hour=hours_range[1], minute=0, second=0, microsecond=0)

    for _ in range(num_tweets):
        # Select a random tweet
        tweet = random.choice(tweets)

        # Calculate the random time to post
        random_seconds = random.randint(0, int((end_time - start_time).total_seconds()))
        post_time = start_time + timedelta(seconds=random_seconds)

        # Wait until the post time
        wait_time = (post_time - datetime.now()).total_seconds()
        if wait_time > 0:
            time.sleep(wait_time)

        # Post the tweet
        post_tweet(tweet)

# Start scheduling tweets
schedule_tweets(tweets)

Aug 08, 2024 Tutorial

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!