Skip to main content

Browserbase Haystack Fetcher

Browserbase is a developer platform to reliably run, manage, and monitor headless browsers.

Power your AI data retrievals with:

Installation and setup

  • Get an API key and Project ID from browserbase.com and set it in environment variables (BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID).
  • Install the required dependencies:
pip install browserbase-haystack

Usage

You can load webpages into Haystack using BrowserbaseFetcher. Optionally, you can set text_content parameter to convert the pages to text-only representation.

Standalone

from browserbase_haystack import BrowserbaseFetcher

browserbase_fetcher = BrowserbaseFetcher()
browserbase_fetcher.run(urls=["https://example.com"], text_content=False)

In a pipeline

from haystack import Pipeline
from haystack.components.generators import OpenAIGenerator
from haystack.components.builders import PromptBuilder
from browserbase_haystack import BrowserbaseFetcher

prompt_template = (
    "Tell me the titles of the given pages. Pages: {{ documents }}"
)
prompt_builder = PromptBuilder(template=prompt_template)
llm = OpenAIGenerator()

browserbase_fetcher = BrowserbaseFetcher()

pipe = Pipeline()
pipe.add_component("fetcher", browserbase_fetcher)
pipe.add_component("prompt_builder", prompt_builder)
pipe.add_component("llm", llm)

pipe.connect("fetcher.documents", "prompt_builder.documents")
pipe.connect("prompt_builder.prompt", "llm.prompt")
result = pipe.run(data={"fetcher": {"urls": ["https://example.com"]}})

Parameters

  • urls Required. A list of URLs to fetch
  • text_content Optional. Only return page text content
  • session_id Optional. The Session ID
  • proxy Optional. Enable Proxy

Metadata

Release files for browserbase-haystack 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for browserbase-haystack 0.0.4
File Size Uploaded
browserbase_haystack-0.0.4.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for browserbase-haystack 0.0.4
File Interpreter ABI Platform
browserbase_haystack-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / browserbase_haystack-0.0.4.tar.gz

Download URL browserbase_haystack-0.0.4.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
423eda63c7e01a2e91e7b61bf924dc6d298e4213436492d98caefbd65c8f1178
BLAKE2b-256 checksum
How to use checksums
c5821396c07589b56ee600fc39851f058942e93723542e0cf26df15a45c1f3b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / browserbase_haystack-0.0.4-py3-none-any.whl

Download URL browserbase_haystack-0.0.4-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96e0762550ab6fae51c30fd632fe3d12d31ef6641fcf34ed8da3568c5f825712
BLAKE2b-256 checksum
How to use checksums
777872bea2ff73abbd9abf22f26bb349bfb25cdb86ccc656bf88381acf8b497b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page