Skip to content

Utilities for analyzing PageGraph outputs

License

Notifications You must be signed in to change notification settings

brave/pagegraph-rust

Repository files navigation

pagegraph

This crate provides utilities for analyzing PageGraph outputs.

Workspace organization

pagegraph provides a core library for interacting directly with pagegraph files and building custom extraction tools.

pagegraph-cli provides a more convenient, no-code wrapper around common operations, supplying outputs in easily-parseable formats.

Example

The following example reads from a PageGraph file and produces all deleted div elements from the corresponding webpage.

use pagegraph::from_xml::read_from_file;
use pagegraph::types::{ NodeType, EdgeType };

fn main() {
    let graph = read_from_file("/path/to/any/pagegraph.graphml");

    let deleted_divs = graph.filter_nodes(|node| {
        match node {
            NodeType::HtmlElement { is_deleted: true, tag_name, .. } if tag_name == "div" => true,
            _ => false,
        }
    });
}

About

Utilities for analyzing PageGraph outputs

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages