Stagehand is an advanced AI Browser Automation Framework designed for web interaction using popular tools like Playwright, Puppeteer, and Selenium. It helps developers to automate browser tasks efficiently, enhancing productivity in various applications.
claude install browserbase/stagehandStagehand is an advanced AI Browser Automation Framework designed for web interaction using popular tools like Playwright, Puppeteer, and Selenium. It helps developers to automate browser tasks efficiently, enhancing productivity in various applications.
["1. Identify the specific task you want to automate using Stagehand. This could be anything from form filling to web scraping or testing.","2. Choose the appropriate browser automation tool (Playwright, Puppeteer, or Selenium) based on your project requirements and familiarity.","3. Write the Stagehand script using the selected tool. Include error handling for common scenarios such as network issues or element not found errors.","4. Test the script thoroughly in a controlled environment to ensure it works as expected. Make any necessary adjustments based on the test results.","5. Deploy the script in your production environment. Monitor its performance and make any necessary optimizations to improve efficiency and reliability."]
Automate web testing processes to ensure application reliability and performance.
Scrape data from websites for market research or data analysis.
Simulate user interactions for quality assurance testing of web applications.
Conduct competitive analysis through automated browsing to gather insights on competitors.
claude install browserbase/stagehandgit clone https://github.com/browserbase/stagehandCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create a Stagehand script using [TOOL] to automate the process of [TASK]. The script should include error handling for [SCENARIO] and log results to [OUTPUT_FILE]. Ensure the script is compatible with [BROWSER] and follows best practices for [FRAMEWORK].
Here's a Stagehand script that automates the process of scraping product data from an e-commerce website using Playwright:
```javascript
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
await page.goto('https://example-ecommerce-site.com/products');
// Handle potential errors during navigation
try {
await page.waitForSelector('.product-item', { timeout: 5000 }); // Wait for products to load
const products = await page.$$eval('.product-item', (items) => {
return items.map(item => {
return {
name: item.querySelector('.product-name').innerText,
price: item.querySelector('.product-price').innerText,
url: item.querySelector('a').href
};
});
});
// Log results to a JSON file
const fs = require('fs');
fs.writeFileSync('products.json', JSON.stringify(products, null, 2));
console.log('Product data has been saved to products.json');
} catch (error) {
console.error('Error during scraping:', error);
} finally {
await browser.close();
}
})();
```
This script includes error handling for scenarios where the product items do not load within the specified timeout. It logs the results to a JSON file named 'products.json' and is compatible with the Chromium browser. The script follows Playwright best practices for web scraping.Automate your browser workflows effortlessly
Control SaaS spending with visibility and analytics
Spreadsheet with built-in API integrations and automation
Your one-stop shop for church and ministry supplies.
Recommend great Internet writing
Web automation framework for AI agents
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan