inspect

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCollect

func FormatCollect(r *CollectResult) string

FormatCollect renders a compact text table from collected items.

func FormatMultiCollect

func FormatMultiCollect(r *MultiCollectResult) string

FormatMultiCollect renders a compact text report for multi-URL results.

func ReactSuspense

func ReactSuspense(page *rod.Page) ([]map[string]any, error)

ReactSuspense returns the current Suspense boundary states.

Types

type CollectResult

type CollectResult struct {
	PageURL   string          `json:"page_url"`
	ItemCount int             `json:"item_count"`
	Items     []CollectedItem `json:"items"`
}

CollectResult holds all collected items from a listing page.

func Collect

func Collect(page *rod.Page, limit int) (*CollectResult, error)

Collect auto-detects repeated listing cards on a page and extracts structured data. It finds elements containing price patterns (€, $, £), groups them by common ancestor, and extracts title, price, URL, and metadata from each card.

type CollectedItem

type CollectedItem struct {
	Title  string            `json:"title"`
	Price  string            `json:"price,omitempty"`
	URL    string            `json:"url,omitempty"`
	Fields map[string]string `json:"fields,omitempty"`
}

CollectedItem is a single listing item extracted from a page.

type MultiCollectResult

type MultiCollectResult struct {
	TotalItems  int          `json:"total_items"`
	TotalTimeMs int64        `json:"total_time_ms"`
	Sites       []SiteResult `json:"sites"`
}

MultiCollectResult holds results from parallel multi-URL collection.

func MultiCollect

func MultiCollect(browser *rod.Browser, urls []string, limit int, stealth bool, maxParallel int) *MultiCollectResult

MultiCollect scrapes multiple URLs in parallel using separate browser tabs. Each URL gets its own tab, navigates, collects, and closes. maxParallel caps the number of concurrent tabs; <= 0 falls back to 5.

type ReactComponent

type ReactComponent struct {
	Name     string           `json:"name"`
	Type     string           `json:"type"`
	Key      string           `json:"key,omitempty"`
	Props    json.RawMessage  `json:"props,omitempty"`
	State    json.RawMessage  `json:"state,omitempty"`
	Children []ReactComponent `json:"children,omitempty"`
}

ReactComponent represents a React component in the fiber tree.

func ReactTree

func ReactTree(page *rod.Page, maxDepth int) ([]ReactComponent, error)

ReactTree extracts the React component tree from the page. Requires React DevTools hook (__REACT_DEVTOOLS_GLOBAL_HOOK__).

type SiteResult

type SiteResult struct {
	URL    string          `json:"url"`
	Items  []CollectedItem `json:"items"`
	Count  int             `json:"count"`
	TimeMs int64           `json:"time_ms"`
	Error  string          `json:"error,omitempty"`
}

SiteResult holds the collect result for a single URL in a multi-collect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL