This demo requires browser-use v0.7.6+.

Features

  1. Agent visits your target website
  2. Captures brand name, tagline, and key selling points
  3. Takes a clean screenshot for design reference
  4. Creates a scroll-stopping Instagram ad with 🍌

Setup

Make sure the newest version of browser-use is installed (with screenshot functionality):
pip install -U browser-use
Export your Gemini API key, get it from: Google AI Studio
export GOOGLE_API_KEY='your-google-api-key-here'

Normal Usage

# Basic - Generate ad from any website
python ad_generator.py https://www.apple.com/iphone-16-pro/

# Debug Mode - See the browser in action
python ad_generator.py https://www.apple.com/iphone-16-pro/ --debug

Programmatic Usage

import asyncio
from ad_generator import create_ad_from_landing_page

async def main():
    results = await create_ad_from_landing_page(
        url="https://your-landing-page.com",
        debug=False
    )
    print(f"Generated ads: {results}")

asyncio.run(main())

Output

Generated ads are saved in the output/ directory with:
  • PNG image files (ad_style_timestamp.png) - Actual generated ads from Gemini 2.5 Flash Image
  • Prompt files (ad_style_timestamp_prompt.txt) - The prompts used for generation
  • Landing page screenshots for reference

Source Code

Full implementation: https://github.com/browser-use/browser-use/tree/main/examples/apps/ad-use