Actions5
Content → Get
AI-generatedOverview
The node interacts with the Browserless API to perform various browser automation tasks such as retrieving web content, scraping JSON data, executing custom JavaScript functions, capturing screenshots, and generating PDFs from web pages. It is useful for automating web data extraction, testing, or rendering dynamic web pages without manual browser interaction.
For the Content - Get operation specifically, the node fetches the raw HTML content of a specified URL using a headless browser session. This can be beneficial when you need the fully rendered HTML of a page (including content generated by JavaScript) rather than just the static source code. Practical examples include scraping product details from e-commerce sites, extracting article content from news websites, or monitoring changes on a webpage.
Properties
| Name | Meaning |
|---|---|
| URL | The target web address to visit and retrieve content from. Must be a valid URL string. |
| Browser Options | Collection of options controlling the browser behavior: - BlockAds: Whether to block advertisement network traffic. - Headless: Run browser in headless mode. - Ignore HTTPS Errors: Ignore HTTPS errors. - Stealth: Enable stealth mode to avoid bot detection. - User Data Dir: Path to reuse previous session data like cookies. - TrackingId: Arbitrary ID for tracking sessions. - Keep Alive: Time in milliseconds to keep browser running after session. - Flags: Command-line flags passed directly to Chrome at startup. |
| Additional Options | Collection of advanced settings: - Http Headers: Extra HTTP headers to send with the request. - Inject Script: Scripts to inject into the page. - Inject Style: Stylesheets to inject. - Authentication: Basic HTTP auth credentials. - Cookies: HTTP cookies to add. - Goto Options: Navigation options like timeout and event to wait for. - Reject Request Pattern: Patterns of requests to block. - Reject Resource Types: Types of resources to block (e.g., images, scripts). - Request Interceptors: Modify intercepted requests. - userAgent: Custom user agent string. - Wait For: Selector or condition to wait for before proceeding. - Set JavaScript Enabled: Enable or disable JavaScript execution. - Viewport: Screen size and device emulation settings. |
Output
- The output JSON contains the retrieved content under a
datafield. - For the Content - Get operation, the
datafield holds the full HTML content of the requested URL as a string. - No binary data is output for this operation.
Example output structure:
[
{
"data": "<!DOCTYPE html><html>...</html>"
}
]
Dependencies
- Requires an active connection to the Browserless API service.
- Needs an API key credential configured in n8n to authenticate requests to Browserless.
- The node uses Puppeteer-based browser automation via the Browserless API endpoint.
Troubleshooting
- Common issues:
- Invalid or unreachable URL: Ensure the URL is correct and accessible.
- Authentication failure: Verify that the API key credential is valid and has proper permissions.
- Network timeouts: Adjust the navigation timeout in "Goto Options" if pages take longer to load.
- Bot detection blocking access: Enable "Stealth" mode to reduce detection by anti-bot systems.
- HTTPS errors: If the target site has certificate issues, enable "Ignore HTTPS Errors".
- Error messages:
"Request failed"or"Timeout exceeded": Increase timeout or check network connectivity."Authentication error": Check API key validity."Page crashed"or"Navigation failed": Try disabling some resource types or blocking ads to reduce load.
Links and References
- Browserless API Documentation
- Chromium Command Line Switches
- Puppeteer GitHub Repository (underlying tech used by Browserless)