Ulixee Hero Documentation

repository·main·Indexed 23 days ago

https://github.com/ulixee/hero

A modern headless browser designed for web scraping that recreates a fully compliant DOM in NodeJS. It utilizes the Chrome engine for fast rendering and advanced browser emulation to avoid detection. The ecosystem includes @ulixee/unblocked-agent for sandboxed scraping sessions, a Pool for sharing Browser processes, and a Browser Profiler for measuring real browser attributes to generate evasion data.

Tokens
224.2K
Snippets
120
Records
1.2K
Agent score
78%

What's inside Ulixee Hero

  1. Overview of Double Agent

    main

    Double Agent is a suite of tools designed to allow a scraper engine to test its detectability by attempting to blend into common web traffic. It operates in two main layers:

    1. /collect: Uses scripts and plugins to collect browser profiles by generating a series of pages to test browser behavior.
    2. /analyze: Uses scripts and plugins to analyze collected profiles against verified profiles. It compares scraper results to legitimate profiles to find discrepancies, providing a "Looks Human"™ score that indicates the likelihood of being flagged as a bot.

    To facilitate the collection phase, the /collect-controller provides a server that generates step-by-step assignments for a scraper to execute all required tests.

  2. Overview of Ulixee Net

    main
    Ulixee Net is a networking library designed with built-in JSON serialization capabilities. It is specifically optimized to preserve more complex data types during the serialization process, making it suitable for networking scenarios where standard JSON serialization might lose type fidelity.
  3. What is DetachedElement and when to use it

    main

    A DetachedElement is used for parsing and traversing local HTML fragments without the overhead of a full browser engine. It is a lightweight, W3C-compliant alternative to libraries like Cheerio or JSDOM.

    Use DetachedElement when you need to manipulate or query HTML strings or existing DOM fragments in a high-performance environment where a full browser instance is unnecessary.

  4. What is an AwaitedDOM Node?

    main

    In the AwaitedDOM API, a Node is a base interface from which various DOM objects inherit (such as Document, Element, Attr, Text, etc.). This allows different types of DOM objects to be treated similarly through a shared set of methods and properties.

    Note on Asynchronicity: Many properties and methods on an AwaitedDOM Node return Promise objects. This is a key distinction from the standard synchronous DOM API.

    Note on Unimplemented Methods: Some standard DOM methods are currently unimplemented in AwaitedDOM, including:

    • appendChild()
    • cloneNode()
    • insertBefore()
    • removeChild()
    • replaceChild()
    • addEventListener()
    • dispatchEvent()
    • removeEventListener()
  5. What is a BrowserContext

    main

    A BrowserContext represents a Chrome Window. In the context of Unblocked Agent, it defaults to an Incognito state.

    Key characteristics:

    • Incognito by default: Provides isolation from other sessions.
    • Proxy Association: An Incognito window can have a dedicated Man-in-the-Middle (MITM) proxy server, which allows for faster and easier association of HTTP requests with specific Page instances within that context.
  6. What is a SuperNode in AwaitedDOM?

    main

    In AwaitedDOM, a SuperNode is an abstraction that implements the properties and methods of the standard DOM Node interface. It serves as a base interface for various DOM API objects, allowing different types of nodes (such as Document, Element, Text, or Comment) to be treated uniformly.

    Key characteristics of SuperNode implementations:

    • Inheritance: All SuperNode types inherit from the Node interface, meaning they share a common set of methods and properties.
    • Polymorphism: You can interact with diverse DOM objects (e.g., HTMLDivElement, SVGElement, DocumentFragment) using the same Node methods.
    • Safety: Methods may return null if a property is not relevant to that specific node type, or they may throw exceptions (for example, if you attempt to add children to a node type that cannot have children).
  7. What is the AwaitedDOM Range interface?

    main

    The Range interface represents a fragment of a document that can contain nodes and parts of text nodes. It allows you to select, manipulate, and query specific portions of the DOM.

    You can create a range using:

    • Document.createRange()
    • The Range() constructor
    • Selection.getRangeAt()
    • Document.caretRangeFromPoint()
  8. What is SuperStyleSheet in AwaitedDOM?

    main
    In the context of AwaitedDOM, SuperStyleSheet is an object that implements the StyleSheet interface, representing a single style sheet. It is designed to provide a more robust or enhanced implementation of standard CSS styling interfaces within the AwaitedDOM environment. It inherits and implements all properties and methods from both the CSSStyleSheet and StyleSheet interfaces.
  9. What is SuperHTMLCollection in AwaitedDOM?

    main
    In the context of AwaitedDOM, SuperHTMLCollection is an enhanced version of the standard HTMLCollection interface. It represents a generic, array-like collection of elements in document order and provides methods and properties for selecting and interacting with those elements. It is designed to work within the AwaitedDOM environment to handle asynchronous element selection and manipulation.
  10. What is an Agent?

    main
    An Agent is the primary interface for working with Unblocked Agent. It coordinates a Man-in-the-Middle (Mitm) proxy and an Incognito window to create a sandboxed web scraping session. Agents support Unblocked Plugins to enhance user interaction behavior or add bot evasions.
  11. What is a Browser?

    main
    A Browser launches a Chrome process and manages Devtools Protocol messages via inner-process communications. In Unblocked Agent, a Browser can be launched once and reused by many different Agents. Browsers can be configured via a BrowserEngine object which contains the executable path and launchArguments.
  12. What is SuperDocument in AwaitedDOM?

    main
    In the context of AwaitedDOM, SuperDocument is an interface representing a web page loaded in the browser. It serves as the primary entry point for interacting with a web page's content via the DOM tree. It includes standard elements like <body> and <table> and provides global document functionality, such as retrieving the page's URL or creating new elements.