Bibliothek / Web Scraping & Recherche
Web Scraping & Recherche
Webseiten mit Bright Data abrufen und mit einer Data Table zwischenspeichern
Wiederverwendbarer Sub-Workflow, den andere Workflows mit einer URL aufrufen; prüft zuerst den zeitgestempelten Data-Table-Cache, andernfalls ruft er die Seite über Bright Data ab und gibt Markdown, HTML oder JSON zurück.
Was sie bewirkt
## One scraper your other workflows call, with a cache in front of it By the fifth workflow that fetches a page you have written the same Bright Data call, the same error check and the same fallback five times. This is that code, once, as a sub-workflow other workflows call with a URL. ### How it works It starts on an Execute Workflow Trigger - no schedule, no webhook. A caller passes url, optionally a format (markdown, html or json) and a max_age_minutes. First it looks in the cache. A Data Table keeps every result with a timestamp, so asking for the same URL inside your freshness window returns instantly and spends nothing. Five workflows checking the same page each morning become one request. On a miss it fetches through Bright Data, then checks the payload properly: Bright Data returns validation errors and blocks with HTTP 200 and an error body, and an empty body means the domain never resolved. If the result is empty or suspiciously thin it retries once with render: true, running the page in a real browser - which is what rescues single-page apps. It always returns the same fields, including ok, from_cache and error, so the caller can branch on the result instead of guessing. ### Setup 1. A Bright Data Header Auth credential and a Web Unlocker zone. 2. A Data Table called scrape_cache with columns url, content, status and fetched_at. It will not add missing ones. 3. In another workflow, add Execute Sub-workflow, pick this one, pass a url.
Die Schritte
- A Workflow Asks For A Page
- Settings
- Read The Request
- Look In The Cache
- Is It Still Fresh?
- Serve From Cache?
- Straight From The Cache
- Fetch The Page
- Read What Came Back
- Does It Need A Browser?
- Try Again In A Browser
- Read The Rendered Page
- The First Fetch Was Fine
- Build The Answer
Insgesamt 15 Schritte.
Ähnliche Automatisierungen
Web Scraping & RechercheBenchmark employer brand on Glassdoor with Bright Data, OpenAI, Sheets and Slack24 SchritteWeb Scraping & RechercheLokale Map-Pack-Rankings über ein Geo-Raster mit Bright Data, OpenAI und Slack abbilden17 SchritteWeb Scraping & RechercheStrukturierte Website-Daten mit Bright Data und Gemini extrahieren16 SchritteWeb Scraping & RechercheTrustpilot-Bewertungen mit Bright Data in Google Sheets scrapen8 Schritte