Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hermes-scorm-extractor

A Hermes skill + standalone toolkit for extracting clean, structured text from SCORM e-learning modules using Chrome DevTools Protocol (CDP). Bypasses bot detection, handles multiple SCORM engines, and outputs RAG-ready markdown.

Hermes Skill License: MIT


What it does

Corporate LMS platforms (Moodle, Totara, etc.) host SCORM training modules behind SSO and bot protection. Standard HTTP scrapers fail. This tool uses your already-authenticated Chrome session via CDP to:

  1. Detect which SCORM engine is running (Articulate Storyline, Lectora, DominKnow)
  2. Navigate through all slides automatically (Previous/Next, sidebar, or preloaded DOM)
  3. Extract clean text per slide with aggressive UI artifact filtering
  4. Output a single markdown file ready for RAG indexing, note-taking, or study

Privacy-first: You provide your own SCORM URLs and authenticate in your own browser. The tool never ships with proprietary content, credentials, or LMS-specific data.


Demo

# 1. Start Chrome with remote debugging
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-profile

# 2. Log into your LMS in that Chrome window

# 3. Extract a SCORM module
python3 scripts/cdp_scorm_extractor.py \
  --lms-url "https://your-lms.com" \
  --scorm-view-id "12345" \
  --output "training_content.md"

Output:

# SCORM Module: Your Role as a Barista

## Slide 1
Welcome to the training module. In this course, you will learn...

## Slide 2
### Key Responsibilities
- Greeting customers warmly
- Taking accurate orders
- Preparing beverages to standard

---

Supported SCORM Engines

Engine Detection Extraction Method
Articulate Storyline SVG <text>/<tspan> elements, aria-label="next" Navigate via NEXT button, extract SVG text
Lectora Dynamic HTML, courseStructure.js body.innerText with artifact filtering
DominKnow courseStructure.js JSON structure Parse JSON text fields (meta, txt, description)
Image-based No DOM text, only button labels Screenshot + OCR fallback (pytesseract)

Installation

Prerequisites

  • Python 3.10+
  • Playwright: pip3 install playwright && playwright install chromium
  • Chrome/Edge/Chromium with remote debugging enabled
  • (Optional) pytesseract for OCR fallback: pip3 install pytesseract pillow

As a Hermes Skill

Copy or symlink the skill directory into your Hermes skills folder:

cp -r skills/scorm-extractor ~/.hermes/skills/

Then use it via slash command:

/scorm-extractor https://demo-lms.com/mod/scorm/view.php?id=123

Standalone

git clone https://github.com/minutechreview/hermes-scorm-extractor.git
cd hermes-scorm-extractor
pip3 install -r requirements.txt

Usage

Quick Start

from scripts.cdp_scorm_extractor import extract_scorm_module

slides = extract_scorm_module(
    cdp_url="http://127.0.0.1:9222",
    lms_base_url="https://your-lms.com",
    scorm_view_id="12345",
    output_path="output.md"
)

Handling Completed/Locked SCORMs

If a SCORM is already completed, it may open in "Review mode" on the last slide. The extractor automatically attempts backward navigation to reach slide 1, then extracts forward. If buttons are CSS-disabled, it uses force=True clicks.

OCR Fallback

For image-based SCORMs where no text exists in the DOM:

from scripts.cdp_scorm_extractor import extract_with_ocr

slides = extract_with_ocr(
    cdp_url="http://127.0.0.1:9222",
    popup_url="https://your-lms.com/pluginfile.php/.../index.html",
    output_path="output.md"
)

Architecture

Your LMS (SSO/Cloudflare protected)
    |
[Your Chrome]  <-- you log in here manually
    |
[CDP Port 9222]
    |
[Playwright script]  <-- connects over CDP, piggybacks auth
    |
[SCORM popup / iframe]  <-- launches manually or via JS
    |
[Slide navigation loop]  <-- clicks NEXT / Previous / sidebar
    |
[DOM extraction + artifact filtering]
    |
[Clean Markdown output]

Why CDP? Corporate LMS platforms often block headless browsers via Cloudflare. CDP connects to your real Chrome instance with your real authenticated session, completely bypassing bot detection.


What's Public vs. Private

In this repo (public) You provide (private)
Generic CDP connection code Your LMS login URL
Engine detection heuristics Your SCORM module links
Artifact filtering rules Your login credentials
Navigation loop patterns Actual training content
OCR fallback logic Internal organization data

Testing with Public Demos

To test without accessing a private LMS, you can use public Articulate Storyline demos:

  1. Find a public Storyline sample (Articulate's website offers free samples)
  2. Host the exported SCORM package on any static file server
  3. Point the extractor at the index.html or story.html URL

The engine detection and SVG text extraction will work the same way.


Contributing

PRs welcome. Please keep all proprietary URLs, credentials, and organization-specific content out of the repo.


License

MIT

About

Hermes skill + toolkit for extracting SCORM e-learning content via Chrome CDP

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages