Skip to content

A few examples of how Dendrite's SDK can be used to automate web processes and build AI agents.

Notifications You must be signed in to change notification settings

dendrite-systems/dendrite-examples

Repository files navigation

Website Documentation Discord

Dendrite Python Examples

This repository has a wide variety of example code using Dendrite that you can try out of the box.

Simple Dendrite Example

# Start the Dendrite browser
browser = Dendrite()

# Navigate to google
browser.goto("https://google.com")

try:
    browser.click("Reject all cookies")
except DendriteException:
    print("No reject all cookies button found")

# Google search "hello world"
browser.fill("Search input field", "hello world")
browser.press("Enter")

# Extract the search results as a list of dicts with url and title
results = browser.extract("The search results as a list of dicts with url and title")
print(results)

Quickstart

Let's get started. First, we're going to install the required packages.

pip install -r requirements.txt

If you are using poetry, run the following:

poetry install

Installing the Web Driver

Now, lets install the web driver for running the Dendrite client locally. If you used pip to install the packages, run:

dendrite install

If you used Poetry, run:

poetry run dendrite install

Environment variables

Finally, you'll need a Dendrite API key, you can get your API key here.

Some examples require more API keys, like Anthropic, to run correctly. See the .env.examples file in the root directory for reference on which keys you'll need.

Try it Out!

Now you can simply run any python file in the repository! Feel free to experiment and modify the scripts. We recommend starting with quickstart/hello_world.py.

Questions?

If you have any questions, check out our documentation or get help in our Discord.

About

A few examples of how Dendrite's SDK can be used to automate web processes and build AI agents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages