Documentation
¶
Overview ¶
Package transport provides a shared network layer for fetching web content. It supports two levels: direct HTTP and browser-based (CDP).
Index ¶
- type Config
- type Transport
- func (t *Transport) BrowseEval(ctx context.Context, url string, js string) (any, error)
- func (t *Transport) BrowseHTML(ctx context.Context, url string) (string, error)
- func (t *Transport) Close() error
- func (t *Transport) Do(ctx context.Context, req *http.Request) (*http.Response, error)
- func (t *Transport) GetHTML(ctx context.Context, url string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// WSURL is the remote CDP WebSocket URL. If empty, a local Chrome is launched.
WSURL string
// ProfileDir is the Chrome user data directory for persistent cookies/storage.
ProfileDir string
// Headless controls whether Chrome runs in headless mode (default: true).
Headless bool
}
Config holds transport configuration.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport provides shared HTTP and browser-based network access.
func (*Transport) BrowseEval ¶
BrowseEval navigates to a URL in a browser and evaluates JavaScript.
func (*Transport) BrowseHTML ¶
BrowseHTML navigates to a URL in a browser and returns the rendered HTML.
Click to show internal directories.
Click to hide internal directories.