Zum Inhalt springen
NEULerne Alaaddin kennen, deinen KI-Flaschengeist mit Stimme. trig8n startet am 1. Januar 2027. Neuigkeiten ansehen

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

  1. A Workflow Asks For A Page
  2. Settings
  3. Read The Request
  4. Look In The Cache
  5. Is It Still Fresh?
  6. Serve From Cache?
  7. Straight From The Cache
  8. Fetch The Page
  9. Read What Came Back
  10. Does It Need A Browser?
  11. Try Again In A Browser
  12. Read The Rendered Page
  13. The First Fetch Was Fine
  14. Build The Answer

Insgesamt 15 Schritte.

Ähnliche Automatisierungen