hubcap goto

Navigate the browser to a URL.

When to use

Use goto to navigate to a URL in the current tab. Add --wait to block until the page is fully loaded. Use reload to reload the current page instead, or back/forward for history navigation.

Usage

hubcap goto [--wait] <url>

Arguments

ArgumentTypeRequiredDescription
urlstringYesThe URL to navigate to. If no scheme is provided, https:// is prepended automatically.

Flags

FlagTypeDefaultDescription
—waitboolfalseWait for page load to complete

Output

Without --wait:

FieldTypeDescription
frameIdstringFrame identifier
loaderIdstringLoader identifier
urlstringThe URL navigated to
{"frameId":"ABC123","loaderId":"DEF456","url":"https://example.com"}

With --wait:

FieldTypeDescription
urlstringThe URL navigated to
frameIdstringFrame identifier
loaderIdstringLoader identifier
loadedboolWhether the page loaded
{"url":"https://example.com","frameId":"ABC123","loaderId":"DEF456","loaded":true}

Errors

ConditionExit codeStderr
Chrome not connected2error: connecting to Chrome: ...
Timeout3error: timeout

Examples

Navigate to a URL:

hubcap goto example.com

Navigate with an explicit scheme:

hubcap goto https://example.com

Navigate and wait for load:

hubcap goto --wait example.com

Navigate, wait, then take a screenshot (chaining):

hubcap goto --wait https://example.com && hubcap screenshot --output page.png

Navigate and extract the page title:

hubcap goto --wait https://example.com && hubcap title

See also

  • reload - Reload the current page
  • back - Navigate back in history
  • forward - Navigate forward in history
  • url - Get the current page URL
  • waitload - Wait for the page load event