An open API service indexing awesome lists of open source software.

https://github.com/browserless/examples

Examples of using Browserless
https://github.com/browserless/examples

Last synced: 29 days ago
JSON representation

Examples of using Browserless

Awesome Lists containing this project

README

          

# Browserless Examples

Runnable code examples for common [Browserless](https://docs.browserless.io/examples) use cases.

## Getting Started

1. **Get an API token:** sign up at [browserless.io](https://browserless.io) and grab your token from the [account dashboard](https://account.browserless.io).

2. **Clone this repo**

```bash
git clone https://github.com/browserless/examples.git
cd examples
```

3. **Pick an example:** browse the [Use cases](#use-cases) table below and open the folder for the task you want to run (e.g. `examples/take-a-screenshot`).

4. **Set your token:** replace `YOUR_API_TOKEN_HERE` in the script with your actual API token.

5. **Run it:** each example folder contains ready-to-run scripts. For example, to take a screenshot with cURL:

```bash
bash examples/take-a-screenshot/rest/curl/screenshot.sh
```

Or with Node.js:

```bash
node examples/take-a-screenshot/frameworks/puppeteer/screenshot.mjs
```

Each example is self-contained. No shared dependencies to install.

## Use cases

| Use case | Description | Languages | Frameworks |
| --- | --- | --- | --- |
| [Auto-Accept Cookie Consent Banners](./examples/auto-accept-cookie-banners) | Detect and dismiss cookie consent banners before scraping or capturing a page | | |
| [Basic Playwright Connection](./examples/basic-playwright-connection) | Connect an existing Playwright script to Browserless by swapping `chromium.launch()` for `connectOverCDP()` | | |
| [Batch DOM Queries](./examples/batch-dom-queries) | Run multiple DOM queries in a single BQL request — all fields execute in the same browser session with no repeated page loads | | |
| [Browse Cloudflare Access-Protected Pages](./examples/browse-cloudflare-access-pages) | Access pages protected by Cloudflare Access zero-trust policies using Service Token headers or a saved authenticated profile | | |
| [Bulk Invoice Download](./examples/bulk-invoice-download) | Log into a sandbox vendor portal, list orders, and extract invoice download links | | |
| [Close a Session](./examples/close-session) | Terminate a BQL or Session API browser session when your automation is complete | | |
| [E2E Testing](./examples/e2e-testing) | Run end-to-end tests against a live remote browser using Playwright, Puppeteer, or BQL | | |
| [Export a Slide Deck](./examples/export-slide-deck) | Export a Google Slides presentation as a PDF by navigating to its export URL | | |
| [Export Pages and Assets](./examples/export-pages-and-assets) | Export a page and all its linked resources (CSS, JS, images) as a ZIP file using the Browserless /export endpoint | | |
| [Fill a Job Application](./examples/fill-job-application) | Fill and submit a job application form on a sandbox career page | | |
| [Fill and Submit a Form](./examples/fill-and-submit-a-form) | Automate form interactions — typing into fields, selecting options, solving CAPTCHAs, and clicking submit | | |
| [Generate a PDF](./examples/generate-a-pdf) | Export any webpage or HTML content as a PDF using the Browserless PDF API | | |
| [Healthcare Portal Extraction](./examples/healthcare-portal-extraction) | Extract patient records from a sandbox healthcare portal dashboard | | |
| [Log In and Reuse Sessions](./examples/login-and-reuse-sessions) | Log in once and reuse that authenticated state across many browser sessions without re-entering credentials | | |
| [Log In via Email OTP](./examples/login-via-email-otp) | Automate login flows that send a one-time passcode to an email address — trigger the OTP, read the code, and enter it | | |
| [Log In with BQL and Browser Automation](./examples/login-with-bql-and-browser-automation) | Automate a login flow — filling credentials, solving CAPTCHAs, and handling post-login redirects | | |
| [Navigate After Click](./examples/navigate-after-click) | Click a link and wait for the resulting page navigation to complete before continuing | | |
| [Persist a Session](./examples/persist-session) | Save and restore browser state across requests for multi-step automation workflows | | |
| [Reconnect to a Browser](./examples/reconnect-to-a-browser) | Reattach to an existing running browser session after disconnecting | | |
| [Record a Browser Session](./examples/record-browser-session) | Capture a browser session as a `.webm` video file using the Browserless recording API | | |
| [Retry with Exponential Backoff](./examples/retry-backoff) | Implement retry logic with exponential backoff around Browserless requests to handle transient failures | | |
| [Route Traffic Through a Proxy](./examples/proxy) | Route browser sessions through a residential or custom proxy | | |
| [Run Concurrent Browser Sessions](./examples/concurrent-browser-sessions) | Launch multiple independent browser sessions in parallel to speed up large-scale scraping or automation | | |
| [Save Logins to Authenticated Profiles](./examples/save-logins-to-authenticated-profiles) | Capture a logged-in browser state once and reuse it across parallel sessions without re-entering credentials | | |
| [Scrape Amazon](./examples/scrape-amazon) | Extract product listings from Amazon search results using stealth mode and a residential proxy | | |
| [Scrape Booking.com](./examples/scrape-booking) | Extract hotel listings from Booking.com using stealth mode and a residential proxy | | |
| [Scrape Etsy](./examples/scrape-etsy) | Search Etsy and extract product titles, prices, and links | | |
| [Scrape GitHub Trending](./examples/scrape-github-trending) | Extract trending repositories from the GitHub trending page | | |
| [Scrape Glassdoor](./examples/scrape-glassdoor) | Extract job listings from Glassdoor using stealth mode and a residential proxy | | |
| [Scrape Google Shopping](./examples/scrape-google-shopping) | Pull product results from Google Shopping search pages using stealth mode | | |
| [Scrape IMDb](./examples/scrape-imdb) | Extract top-rated movies from the IMDb Top 250 chart using stealth mode | | |
| [Scrape Indeed](./examples/scrape-indeed-jobs) | Extract job listings from Indeed search results using stealth mode and a residential proxy | | |
| [Scrape LinkedIn Jobs](./examples/scrape-linkedin-jobs) | Extract job listings from LinkedIn search results using stealth mode and a residential proxy | | |
| [Scrape OpenTable](./examples/scrape-opentable) | Extract restaurant listings from OpenTable using stealth mode and a residential proxy | | |
| [Scrape Realtor.com](./examples/scrape-realtor) | Extract property listings from Realtor.com using stealth mode and a residential proxy | | |
| [Scrape Reddit](./examples/scrape-reddit) | Extract posts from a subreddit using stealth mode | | |
| [Scrape Ticketmaster](./examples/scrape-ticketmaster) | Extract event listings from Ticketmaster using stealth mode and a residential proxy | | |
| [Scrape Walmart](./examples/scrape-walmart) | Extract product listings from Walmart search results using stealth mode and a residential proxy | | |
| [Scrape Yelp](./examples/scrape-yelp) | Extract business listings from Yelp search results using stealth mode and a residential proxy | | |
| [Scrape YouTube](./examples/scrape-youtube) | Extract video results from YouTube search pages using stealth mode | | |
| [Scrape Zillow](./examples/scrape-zillow) | Extract property listings from Zillow using stealth mode and a residential proxy | | |
| [Solving Cloudflare Challenges](./examples/solve-cloudflare-challenges) | Bypass Cloudflare Turnstile and JS challenges using the `/unblock` endpoint or BQL's `solve` mutation | | |
| [Solving reCAPTCHAs](./examples/solve-recaptchas) | Automatically detect and solve reCAPTCHA v2, v3, invisible, and other CAPTCHA challenges during browser automation | | |
| [Take a Screenshot](./examples/take-a-screenshot) | Capture any webpage as a PNG or JPEG using the Browserless screenshot API | | |