Skip to content

Preserve image/icon metadata during scrape extraction #10

Description

@quackerd

Problem Description

The current scrape-to-Markdown conversion appears to drop semantic information when a page represents data using icons or images instead of text nodes.

A concrete example is:

https://dota2protracker.com/hero/Ember%20Spirit

When scraping the page, sections such as:

Most common Inventories in lategame
Minute 20-35
Minute 35-55
Minute 55+

Neutral Items
Tier 1
20.7% 51.1% wr
12.9% 52.1% wr
11.0% 51.2% wr
...

retain the percentages, but the corresponding item names are lost because they are represented by icons/images in the page.

src/scrape/markdown.ts::renderNode() currently handles text nodes, headings, lists, tables, etc., but there does not appear to be handling for semantic image attributes such as alt, title, or aria-label.

Motivation

Many websites use icons instead of texts in tables, dashboards, build lists, statistics pages, etc. Dropping those labels can also drop semantic meanings surrounding the numeric/text content.

Expected Behavior

I think scrape should preserve meaningful metadata associated with images/icons when available.

For example, <img src="..." alt="Octarine Core"> could produce something like Octarine Core or ![Octarine Core](...).

The exact output format is flexible but the important part is that semantic labels of images are not silently discarded.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions