# Offline testing (https://www.scrape-sdk.com/docs/guides/offline-testing)

Canonical: https://www.scrape-sdk.com/docs/guides/offline-testing
Markdown: https://www.scrape-sdk.com/docs/guides/offline-testing.md



```ts
import { createScrapeClient } from "scrape-sdk";
import { local } from "scrape-sdk/local";

const scraper = createScrapeClient({
  provider: local({
    fetch: async (url) => new Response("<html><article><h1>Hi</h1></article></html>", {
      headers: { "content-type": "text/html" },
    }),
  }),
});

const page = await scraper.scrape("https://example.com");
```

Every adapter accepts `fetch` in its config so tests can pin real request URLs and JSON shapes without the network.