Skip to content

Latest commit

 

History

History
64 lines (39 loc) · 2.42 KB

remote-browser.mdx

File metadata and controls

64 lines (39 loc) · 2.42 KB
title description icon
Remote Browser
Start running web automations at scale.
arrow-trend-up

Scaling up

The local Dendrite browser is great for development, but if you want to start scaling up you might want to use a hosted browser instead. We currently support Browserless and Browserbase as provider.

Browserless

To get started you'll need to head over to Browserless and create an account. Get the API Key and save them in your .env file like this:

# ... previous keys 
BROWSERLESS_API_KEY=

To start using the the remote browser you just need to specify the remote_config argument when initiating Dendrite. Import the BrowserlessConfig as following from dendrite.remote import BrowserlessConfig.

# from dendrite_python_sdk import DendriteBrowser
from dendrite.remote import BrowserlessConfig

browser = Dendrite(remote_config = BrowserlessConfig())
async_browser = AsyncDendrite(remote_config = BrowserlessConfig())

You can use the remote browser just as you would the local Dendrite browser. The only difference is that the browser is running in the cloud.

Browserbase

To get started you'll need to head over to Browserbase and create an account. Get both the Project ID and API Key and save them in your .env file like this:

# ... previous keys 
BROWSERBASE_API_KEY=
BROWSERBASE_PROJECT_ID=

To start using the the remote browser you just need to specify the remote_config argument when initiating Dendrite. Import the BrowserbaseConfig as following from dendrite.remote import BrowserbaseConfig.

# from dendrite_python_sdk import DendriteBrowser
from dendrite.remote import BrowserbaseConfig

browser = Dendrite(remote_config = BrowserbaseConfig())
async_browser = AsyncDendrite(remote_config = BrowserbaseConfig())

You can use the remote browser just as you would the local Dendrite browser. The only difference is that the browser is running in the cloud.

Proxy and downloads

You can active rotating proxies by setting enable_proxy=True when creating the BrowserbaseConfig. The proxies are provided by Browserbase and you can track your usage on their website.

When using Browserbase as provider it is extra important that you call browser.close=() when you're done. Otherwise the Browserbase session will continue until it timeouts.