# Docs Text Exporter

> Source: <https://gist.github.com/tobfd/86f564fe1a01d752afab02c9d1351f9e>
> Published: 2026-09-25 21:49:28+00:00

A quick DevTools snippet to extract clean, readable text from documentation pages (Chrome Docs, React, Python, etc.) directly into your clipboard.

Removes navigation bars, sidebars, and HTML clutter—giving LLMs (ChatGPT, Claude, Gemini) pure text and code examples without wasting context tokens.

1. Open DevTools in your browser (`F12` or`Ctrl + Shift + I` /`Cmd + Option + I` ).
2. Go to the **Console** tab.
3. Paste the following code and press **Enter** :

``` js
(() => {
  // Finds the main documentation content area (falls back to body)
  const mainContent = document.querySelector('main, article, [role="main"]') || document.body;
  
  // Copies clean readable text without HTML layout clutter
  copy(mainContent.innerText);
  console.log('Documentation text copied to clipboard!');
})();
```

1. Paste the extracted documentation directly into your AI prompt!
