hybrid

package
v0.0.0-...-d572591 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package hybrid provides hybrid automation combining UI browser interactions with HTTP API requests using shared browser session state (cookies, headers).

This is useful for scenarios where you want to:

  • Perform authentication via browser UI
  • Use extracted cookies for direct API calls
  • Combine scraping with API requests for efficiency

Example usage:

// Create hybrid client from browser page
client, err := hybrid.NewClient(page)
if err != nil {
    log.Fatal(err)
}

// Make API request with browser cookies
resp, err := client.Get("https://api.example.com/data")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CookiesFromPage

func CookiesFromPage(page *rod.Page) ([]*http.Cookie, error)

CookiesFromPage extracts cookies from a browser page

func NewCookieJar

func NewCookieJar(cookies []*http.Cookie) (http.CookieJar, error)

NewCookieJar creates a cookie jar from browser cookies

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps an HTTP client with browser session state

func NewClient

func NewClient(page *rod.Page) (*Client, error)

NewClient creates a new hybrid client from a browser page

func (*Client) Get

func (c *Client) Get(url string) (*http.Response, error)

Get makes an HTTP GET request with browser cookies

func (*Client) Post

func (c *Client) Post(url, contentType string, body io.Reader) (*http.Response, error)

Post makes an HTTP POST request with browser cookies

func (*Client) SetHeader

func (c *Client) SetHeader(key, value string)

SetHeader sets a header for all requests

Jump to

Keyboard shortcuts

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