Skip to main content

Custom word list generator for web content

Project description

CeWLio ๐Ÿ•ต๏ธโ€โ™‚๏ธโœจ

AI-Assisted Development Python License Tests

CeWLio is a powerful, Python-based Custom Word List Generator inspired by the original CeWL by Robin Wood. While CeWL is excellent for static HTML content, CeWLio brings modern web scraping capabilities to handle today's JavaScript-heavy websites. It crawls web pages, executes JavaScript, and extracts:

  • ๐Ÿ“š Unique words (with advanced filtering)
  • ๐Ÿ“ง Email addresses
  • ๐Ÿท๏ธ Metadata (description, keywords, author)

Perfect for penetration testers, security researchers, and anyone needing high-quality, site-specific wordlists!

๐Ÿค– AI-Assisted Development: This project was created with the help of AI tools, but solves real-world problems in web scraping and word list generation. Every line of code has been carefully reviewed, tested, and optimized for production use.


๐Ÿ”„ CeWL vs CeWLio: What's Different?

Feature Original CeWL CeWLio
Language Ruby Python 3.12+
JavaScript Support โŒ Static HTML only โœ… Full JavaScript rendering
Browser Engine Basic HTTP requests ๐Ÿš€ Playwright (Chromium/Firefox/WebKit)
Modern Web Support โŒ Struggles with SPAs โœ… Handles React, Vue, Angular
Word Processing Basic filtering ๐ŸŽฏ Advanced: length, case, umlauts, groups
Email Extraction Basic regex ๐Ÿ” Smart: content + mailto links
API Access โŒ CLI only โœ… Python API + CLI
Testing Limited ๐Ÿงช 100% test coverage
Installation Ruby gems ๐Ÿ“ฆ pip install cewlio
Cross-Platform Ruby dependencies โœ… Universal Python package
Active Development โŒ Limited updates โœ… Modern, actively maintained

๐Ÿš€ Features

  • JavaScript-Aware Extraction: Uses headless browser to render pages and extract content after JavaScript execution
  • Advanced Word Processing:
    • Minimum/maximum word length filtering
    • Lowercase conversion
    • Alphanumeric or alpha-only words
    • Umlaut conversion (รคโ†’ae, รถโ†’oe, รผโ†’ue, รŸโ†’ss)
    • Word frequency counting
  • Word Grouping: Generate multi-word phrases (e.g., 2-grams, 3-grams)
  • Email & Metadata Extraction: Find emails from content and mailto links, extract meta tags
  • Flexible Output: Save words, emails, and metadata to separate files or stdout
  • Professional CLI: All features accessible via command-line interface
  • Comprehensive Testing: 100% test coverage

๐Ÿ› ๏ธ Installation

From PyPI (Recommended)

pip install cewlio

From Source

git clone https://github.com/yourusername/cewlio
cd cewlio
pip install -e .

Dependencies

  • Python 3.12+
  • Playwright (for browser automation)
  • BeautifulSoup4 (for HTML parsing)
  • Requests (for HTTP handling)

โšก Quick Start

Basic Usage

# Extract words from a website
cewlio https://example.com

# Save words to a file
cewlio https://example.com -o wordlist.txt

# Extract emails and metadata
cewlio https://example.com --email emails.txt --metadata meta.txt

Advanced Examples

Generate word groups with counts:

cewlio https://example.com --groups 3 --count -o phrases.txt

Custom word filtering:

cewlio https://example.com --min-length 4 --max-length 12 --lowercase --convert-umlauts

Handle JavaScript-heavy sites:

cewlio https://example.com -w 5 --visible

Extract only emails and metadata:

cewlio https://example.com --no-words --email emails.txt --metadata meta.txt

๐ŸŽ›๏ธ Command-Line Options

Option Description Default
url URL to process Required
-o, --output Output file for words stdout
--email Output file for email addresses -
--metadata Output file for metadata -
--min-length Minimum word length 3
--max-length Maximum word length No limit
--lowercase Convert words to lowercase False
--with-numbers Include words with numbers False
--convert-umlauts Convert umlaut characters False
--count Show word counts False
--groups Generate word groups of specified size -
-w, --wait Wait time for JavaScript execution (seconds) 0
--visible Show browser window False
--timeout Browser timeout (milliseconds) 30000
--no-words Don't extract words (only emails/metadata) False

๐Ÿ“š API Usage

Basic Python Usage

from cewlio import CeWLio

# Create instance with custom settings
cewlio = CeWLio(
    min_word_length=4,
    max_word_length=12,
    lowercase=True,
    convert_umlauts=True
)

# Process HTML content
html_content = "<p>Hello world! Contact us at test@example.com</p>"
cewlio.process_html(html_content)

# Access results
print("Words:", list(cewlio.words.keys()))
print("Emails:", list(cewlio.emails))
print("Metadata:", list(cewlio.metadata))

Process URLs

import asyncio
from cewlio import CeWLio, process_url_with_cewlio

async def main():
    cewlio = CeWLio()
    success = await process_url_with_cewlio(
        url="https://example.com",
        cewlio_instance=cewlio,
        wait_time=5,
        headless=True
    )
    
    if success:
        print(f"Found {len(cewlio.words)} words")
        print(f"Found {len(cewlio.emails)} emails")

asyncio.run(main())

๐Ÿงช Testing

The project includes a comprehensive test suite with 33 tests covering all functionality:

  • โœ… Core functionality tests (15 tests)
  • โœ… HTML extraction tests (3 tests)
  • โœ… URL processing tests (2 tests)
  • โœ… Integration tests (3 tests)
  • โœ… Edge case tests (10 tests)

Total: 33 tests with 100% success rate

For detailed testing information and development setup, see CONTRIBUTING.md.


๐Ÿ› Troubleshooting

Common Issues

"No module named 'playwright'"

pip install playwright
playwright install

JavaScript-heavy sites not loading properly

# Increase wait time for JavaScript execution
cewlio https://example.com -w 10

Browser timeout errors

# Increase timeout and wait time
cewlio https://example.com --timeout 60000 -w 5

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines on:

  • ๐Ÿš€ Getting started with development
  • ๐Ÿ“ Code style and formatting guidelines
  • ๐Ÿงช Testing requirements and procedures
  • ๐Ÿ”„ Submitting pull requests
  • ๐Ÿ› Reporting issues
  • ๐Ÿ’ก Feature requests

Quick start:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

For detailed development setup and guidelines, see CONTRIBUTING.md.


๐Ÿ“ Changelog

v1.0.0

  • โœจ Initial release
  • ๐ŸŽฏ Complete word extraction with filtering
  • ๐Ÿ“ง Email extraction from content and mailto links
  • ๐Ÿท๏ธ Metadata extraction from HTML meta tags
  • ๐Ÿ”ง Professional CLI interface
  • ๐Ÿงช Comprehensive test suite (33 tests)
  • ๐Ÿ“ฆ PyPI-ready packaging

๐Ÿ“„ License

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


๐Ÿ™ Credits


๐Ÿ“ž Support


Made with โค๏ธ for the security community

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

cewlio-1.0.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

cewlio-1.0.1-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file cewlio-1.0.1.tar.gz.

File metadata

  • Download URL: cewlio-1.0.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cewlio-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7a6b0b6c3aa29e6e2cb998ad452fb5f7f46ec61801487ca7ac9a9e678caa2afc
MD5 f5f68e13c42fafbf4aa76d2669ec5414
BLAKE2b-256 75c96da9b1d1929f36b4d9e0197ae5181a10f4729f0b4770c12b93ba62f4d5b8

See more details on using hashes here.

File details

Details for the file cewlio-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cewlio-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cewlio-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9644ca68353e5d3b4fb2bc6860ec619a8f64f71116d031643542af4d9f237fdd
MD5 56d5db5b2191ac89182cef88c11f9afc
BLAKE2b-256 84e68811c7436524ebf5116f2ea8a5e54a613755c5a9eb53a0ea1ec13592d0c4

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