Skip to main content

A scraper for free courses from coursekingdom.xyz

Project description

Learn4Free

A Python module to scrape free course information from coursekingdom.xyz.

Features

  • Scrape all courses or search for specific courses based on a search term
  • Extracts course details including title, role, image, link, course link, coupon code, page number, and cleanly formatted date
  • Utilizes multithreading for efficient scraping
  • Includes a command-line interface for easy usage

Installation

Install the package via pip:

pip install learn4free

Usage

As a Module

Import and use the CourseScraper class in your Python code:

from learn4free import CourseScraper

# Initialize the scraper with optional search term and max workers
scraper = CourseScraper(max_workers=10, search_term="python")

# Scrape all courses
courses = scraper.scrape_all_courses()

# Process the courses
for course in courses:
    print(course)

As a Command-Line Tool

Run the scraper from the command line after installation:

learn4free --help

learn4free --search "python" --page 2 --thread 10 --output courses.json
  • If --search is provided, it scrapes courses matching the search term.

Example output:

                                                                        === Welcome to Learn4Free ===                                                                        
                                                            Scrape free courses from coursekingdom.xyz with ease!                                                            
                                                                --------------------------------------------                                                                 

Scraping Hacking on page 1 with 20 threads...

Scraping completed in 13.21 seconds
Total courses found: 12

                                                                               Scraped Courses                                                                               
╭───────┬───────┬───────────────────────────────────────────────┬─────────────────┬──────────────────────┬─────────────────┬────────────────────────────────────────────────╮
│  No.  │ Page  │ Title                                         │ Role            │ Coupon Code          │ Date            │ Course Link                                    │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   1   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ 5856A5B9D68A7AED1D84 │ 19 March, 2025  │ https://www.udemy.com/course/web-hacking-for-… │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   2   │   1   │ BlackHat Live : Hands-On Hacking, No Theory   │ IT & Software   │ B27EE3CD5826316928BE │ 14 March, 2025  │ https://www.udemy.com/course/blackhat-live-ha… │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   3   │   1   │ Android Hacking & Security: Ethical Hacking   │ IT & Software   │ FIRST1000            │ 12 March, 2025  │ https://www.udemy.com/course/android-hacking-… │
│       │       │ for Beginners                                 │                 │                      │                 │                                                │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   4   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ B0387F32AEAE39E22C78 │ 11 March, 2025  │ https://www.udemy.com/course/web-hacking-for-… │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   5   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ LEARNMARCH           │ 1 March, 2025   │ https://www.udemy.com/course/web-hacking-for-… │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   6   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ 150D60554FF786EB4CB5 │ 12 February,    │ https://www.udemy.com/course/web-hacking-for-… │
│       │       │                                               │                 │                      │ 2025            │                                                │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   7   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ D7D06321E9E4047C4B03 │ 6 February,     │ https://www.udemy.com/course/web-hacking-for-… │
│       │       │                                               │                 │                      │ 2025            │                                                │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   8   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ 2155D715514885027251 │ 3 February,     │ https://www.udemy.com/course/web-hacking-for-… │
│       │       │                                               │                 │                      │ 2025            │                                                │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│   9   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ 3E61ADB8E7C6E545E312 │ 19 January,     │ https://www.udemy.com/course/web-hacking-for-… │
│       │       │                                               │                 │                      │ 2025            │                                                │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│  10   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ LEARN-JAN            │ 8 January, 2025 │ https://www.udemy.com/course/web-hacking-for-… │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│  11   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ 6C8F88528D7DA2180A47 │ 2 January, 2025 │ https://www.udemy.com/course/web-hacking-for-… │
├───────┼───────┼───────────────────────────────────────────────┼─────────────────┼──────────────────────┼─────────────────┼────────────────────────────────────────────────┤
│  12   │   1   │ Web Hacking For Beginners                     │ IT & Software   │ DEC-LEARN-MORE       │ 27 December,    │ https://www.udemy.com/course/web-hacking-for-… │
│       │       │                                               │                 │                      │ 2024            │                                                │
╰───────┴───────┴───────────────────────────────────────────────┴─────────────────┴──────────────────────┴─────────────────┴────────────────────────────────────────────────╯
                                                                                                                                                                             
                                                                   === Thank you for using Learn4Free! ===                                                                   

Requirements

  • Python 3.6 or higher
  • requests
  • beautifulsoup4
  • fake-useragent
  • rich

Notes

  • Website Dependency: This scraper is tailored to the current structure of coursekingdom.xyz. Changes to the website may require updates to the code.
  • Responsible Use: Respect the website’s terms of service. Adjust max_workers (default 20 in CLI, 30 in class) to avoid overloading the server.
  • Date Formatting: Dates are cleaned to remove non-breaking spaces and extra whitespace for consistency.
  • Robustness: Includes retry logic with exponential backoff for failed requests.

Acknowledgments

A special thanks to CourseKingdom for providing a platform to discover free courses, making education accessible to everyone!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

learn4free-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

learn4free-1.0.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file learn4free-1.0.0.tar.gz.

File metadata

  • Download URL: learn4free-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for learn4free-1.0.0.tar.gz
Algorithm Hash digest
SHA256 491da7c3b9fc609ef2f03b0a67543e81d9dc219168f3566822032e894f3fb5be
MD5 d285bdc3cde2ec302afd6d4a6cc83425
BLAKE2b-256 555c810b0f3e1b97988895f84a83bfeaaafc6d32d9137c93c20917f5fc7f8b0b

See more details on using hashes here.

File details

Details for the file learn4free-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: learn4free-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for learn4free-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba163e744bec9b683ca370aa9eaf0984b9e473ea2263a2e96736edf4d34c0c37
MD5 a9bfaa3283f89822ec143a8c062e9a2b
BLAKE2b-256 97c7d3627544e1ace6738b812d866148a517ad1c9df09d492e5d461894259a9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page